Python Section 5 - MCQ
1 .
Which is not a valid Python loop?

Correct Answer : Option (D)

iter loop
2 .
What is a nested loop?

Correct Answer : Option (B)

a loop called from an object
3 .
Which of the following is a valid way to start a while loop in Python?

Correct Answer : Option (B)

while a < 10:
4 .
How to access list elements?

Correct Answer : Option (A)

print l->get(0)
5 .
What gets printed?
nums = set([1,1,2,3,3,3,4])
print(len(nums))​

Correct Answer : Option (C)

4
6 .
How do you create a variable “a” that is equal to 2?

Correct Answer : Option (C)

a = 2
7 .
Which of the following is not a valid assignment operator?

Correct Answer : Option (D)

X=
8 .
Which one of the following is a valid Python if statement

Correct Answer : Option (A)

 if a >= 22:
9 .
The output of the code shown below:
import time
time.asctime()

Correct Answer : Option (C)

Current date and time
10 .
Which of the following is a valid way to start a function in Python?

Correct Answer : Option (A)

def someFunction():