Tag: While and For Loops
-
Python Quizs Question and Answers – While and For Loops – 2
Q 1. What will be the output of the following Python code? x = “abcdef” while i in x: print(i, end=” “) A. a b c d e fB. abcdefC. i i i i i i …D. error Show Answer Answer:-D. error Explanation NameError, i is not defined. Q 2. What will be the output…
-
Python Multiple Choice Quizs Question – While and For Loops 1
Q 1. What will be the output of the following Python code? i = 1 while True: if i%3 == 0: break print(i) i + = 1 A. 1 2B. 1 2 3C. errorD. none of the mentioned Show Answer Answer:-C. error Explanation SyntaxError, there shouldn’t be a space between + and = in…