Direction: Choose the correct option
Q1.
What is the output of `for i in range(3): print(i)`?
Direction: Choose the correct option
Q2.
Which keyword is used to exit a loop prematurely?
Direction: Choose the correct option
Q3.
What does the `else` clause do in a loop?
Direction: Choose the correct option
Q4.
Given `x = 10`, what will `if x: print(x) else: print('no')` output?
Direction: Choose the correct option
Q5.
Which of the following is a valid one-line conditional expression (ternary operator)?
Direction: Choose the correct option
Q6.
What is the result of `[i for i in range(5) if i % 2 == 0]`?
Direction: Choose the correct option
Q7.
How do you skip the rest of the current iteration in a loop?
Direction: Choose the correct option
Q8.
What is the output of `i=0; while i<3: print(i); i+=1`?
Direction: Choose the correct option
Q9.
Which statement is used to do nothing as a placeholder?
Direction: Choose the correct option
Q10.
What is the output of `if None: print('True')`?
