Control Structures – Multiple Choice Questions (MCQs)
-
-
38. What is the output of the following code? `r = 'world'; for char in r: if char == 'o': continue; print(char)`?
-
39. What is the output of the following code? `u = 5; if u > 10: print('A') elif u > 3: print('B') elif u > 0: print('C') else: print('D')`?
-
40. What is the output of the following code? `v = -2; if v > 10: print('A') elif v > 3: print('B') elif v > 0: print('C') else: print('D')`?
-
41. What is the output of the following code? `w = 0; if w > 10: print('A') elif w > 3: print('B') elif w > 0: print('C') else: print('D')`?
-
42. What is the output of the following code? `y = [1, 2, 3]; for i in range(len(y)): if y[i] == 2: break; print(y[i])`?
-
43. What is the output of the following code? `z = [1, 2, 3]; for i in range(len(z)): if y[i] == 2: continue; print(z[i])`?