Search Header Logo

innofesta2k24

Authored by Devamithra Devamithra

Computers

University

Used 4+ times

innofesta2k24
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following Python code?

x = [1, 2, 3, 4]

y = x

y[0] = 10

print(x)

A) [10, 2, 3, 4]

B) [1, 2, 3, 4]

C) [10, 10, 10, 10]

D) [10, 2, 4]

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

def func(x, y=[]):

y.append(x)

return y

print(func(1))

print(func(2, []))

print(func(3))

A) [1], [2], [3]

B) [1], [2], [1, 3]

C) [1], [2]

D) [1], [2], [1, 2, 3]

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the result of this code?

x = {1, 2, 3}

y = {3, 4, 5}

print(x & y)

A) {1, 2, 3, 4, 5}

B) {3}

C) {1, 2, 3}

D) {4, 5}

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the result of the following code snippet?

a = [1, 2, 3]

b = a

b += [4, 5]

print(a)

A) [1, 2, 3, 4, 5]

B) [1, 2, 3]

C) [4, 5]

D) [1, 2, 3] and [4, 5]

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code?

x = 7

y = 3

print(x % y)

A. 2

B. 3

C. 1

D. 0

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will the following code print?

def multiply(a, b=2):

return a * b

print(multiply(5))

A. 7

B. 10

C. 25

D. 5

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code?

def func(x, y=[]):

y.append(x)

return y

print(func(1))

print(func(2, []))

print(func(3))

A. [1], [2], [3]

B. [1], [2], [1, 3]

C. [1], [2], [2, 3]

D. [1], [2, 3], [1, 2, 3]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?