Question: 31 -
Study the following program: What will be the output of this statement?i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0)
-
0 1 2
-
3 2 1
-
1 2 3
-
0 1 2 3
Answer:
0 1 2
Solution not available.
Question: 32 -
Study the following program: Which of the following is the correct output of this program?i = 1: while True: if i%3 == 0: break print(i)
-
3 2 1
-
1
-
Invalid Syntax
-
1 2 3
Answer:
Invalid Syntax
Solution:
Invalid syntax, because this declaration (i = 1:) is wrong.
Invalid syntax, because this declaration (i = 1:) is wrong.
Question: 33 -
Study the following program: What will be the output of this statement?i = 0 while i < 3: print(i) i += 1 else: print(0)
-
0 1 2
-
0 1 2 3
-
0 1 2 0
-
0 1
Answer:
0 1 2 0
Solution not available.
Question: 34 -
Study the following program: Which of the following is correct output of this program?a = 1 while True: if a % 7 = = 0: break print(a) a += 1
-
Invalid syntax
-
1 2 3 4 5 6 7
-
1 2 3 4 5
-
1 2 3 4 5 6
Answer:
1 2 3 4 5 6
Solution not available.
Question: 35 -
Study the following program: Which of the following is correct output of this program?x = ['xy', 'yz'] for i in a: i.upper() print(a)
-
['xy', 'yz']
-
['XY', 'YZ']
-
[None, None]
-
None of these
Answer:
['xy', 'yz']