Logo

Python Questions Set 123:

Quiz Mode

a = 5

a += 5

print(a)

1
2
3
4

Solution:

Deduce output of the following code:


>>> 2//3**7

Solution:

Which of the following is not a valid namesapce?

1
2
3
4

Solution:

What is the output of the following code?


x = 23

print(len(x*4))

1
2
3
4

Solution:

What is used to separate multiple statements on a single line in Python?

1
2
3
4

Solution:

What will be the output of the following Python code?

a = 9
b = 5
d = a - b
c = d * a
e = c // 9
print(e)
print(c)

1
2
3
4

Solution:

What is the output of the following code?

for i in range(0,2): for j in range(0,i+1): print("*",end="") print()

1
2
3
4

Solution:

What will be the output of the following Python code?


x = (i for i in range(3))  

for i in x:  

    print(i) 

1
2
3
4

Solution:

What will be the output of the following Python code?

>>> a=("Check")*3
>>> a

1
2
3
4

Solution:

 What happens if a local variable exists with the same name as the global variable you want to access? 

1
2
3
4

Solution: