Logo

Python Questions Set 179:

Quiz Mode

a={}

a[2]=1

a[1]=[2,3,4]

print(a[1][1])

1
2
3
4

Solution:

Which of the following is not a complex number?

1
2
3
4

Solution:

 The expression Int(x) implies that the variable x is converted to integer. 

1
2

Solution:

 Which of the following creates a pattern object? 

1
2
3

Solution:

After how many seconds will the 'Hello' message be printed?

1
2
3
4

Solution:

Maximum Possible Length of the Identifier 

1
2
3
4

Solution:

What will be the output of the following code?

for i in range(3): if i == 1: continue print(i)

1
2
3
4

Solution:

What will be the output of the following Python code snippet?



string = "my name is x"

for i in ' '.join(string.split()):

    print (i, end=", ")

1
2
3
4

Solution:

What will be the output of the following code?

class Rectangle:
pass
rect1 = Rectangle()
rect2 = Rectangle()
rect1.height = 20
rect2.height = 30
rect1.width = 40
rect2.width = 10
print(rect1.height * rect1.width)
print(rect2.height * rect2.width)

1
2
3
4

Solution:

What is the most important benefit of writing your own functions?

1
2
3
4

Solution: