PYTHON QUIZ
1 .
Which is not a valid Python loop?

Correct Answer : Option (D)

iter loop
  Show Answer
2 .
What is a nested loop?

Correct Answer : Option (B)

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

Correct Answer : Option (B)

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

Correct Answer : Option (A)

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

Correct Answer : Option (C)

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

Correct Answer : Option (C)

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

Correct Answer : Option (D)

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

Correct Answer : Option (A)

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

Correct Answer : Option (C)

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

Correct Answer : Option (A)

def someFunction():
  Show Answer