What value does the following expression evaluate to ?
x = 5while x < 10: print(x, end='')
Closed loop
one time loop
Infinite loop
Evergreen loop
What will be the output of the following Python code?
for i in range(int(2.0)): print(i)
0.0 1.0
0 1
error
none of the mentioned
x = "abcdef" i = "a" while i in x: print('i', end = " ")
no output
i i i i i i … infinite Time
a a a a a a …
a b c d e f
What will be the output after the following statements?
for i in range(1,6): print(i, end='') if i == 3: break
1 2
1 2 3
1 2 3 4
1 2 3 4 5
What is the output of the following program:
i = 0while i < 3: print (i) i=i+1 print (i+1)
0 2 1 3 2 4
0 1 2 3 4 5
0 1 2 3
What will be the output of the following Python code snippet?
x = 'abcd' for i in range(len(x)): print(x) x = 'a'
a
abcd abcd abcd abcd
a a a a
Entry Controlled Loop
Exit Controlled Loop
Both of the above
None of the above
colon
comma
semicolon
hyphen
a = 0b = 3while a + b < 8: a += 1 print(a, end='')
0 1 2 3 4
1 2 3 4 5 6
None of these
What is the output of the following code?
for i in range(3): print(i,end=" ")
0 1 2
Error
11
8
1
0
x = "abcdef"i = "a"while i in x: print(i, end = " ")
i i i i i i …
True
False
Infinite
NULL
for i in range(2.0): print(i)
x = "abcdef"while i in x: print(i, end=" ")
abcdef
x = 'abcd'for i in range(len(x)): print(i)
a b c d
; (semicolon)
,(Comma)
: (colan)
i = 2while True: if i%3 == 0: break print(i) i += 2
2 4 6 8 10 …
2 4
2 3
for i in range(5): if i == 5: break else: print(i)else: print("Here")
0 1 2 3 4 Here
0 1 2 3 4 5 Here
x = 'abcd' for i in range(len(x)): x = 'a' print(x)
abcd abcd abcd
x = "abcdef"i = "i"while i in x: print(i, end=" ")
for
while
Both A and B
x = 2for i in range(x): x += 1 print (x)
0 1 2 3 4 …
3 4
for i in range(0): print(i)
i = 1while False: if i%2 == 0: break print(i) i += 2
1 3 5 7 …
1 2 3 4 …
Nothing will be printed
i = 1while True: if i%7 == 0: break print(i) i += 1
1 2 3 4 5 6 7
count=0while count<3: print(count,end=" ") count+=1
do..while
if..elif
Selection
Sequential
Simple
Loop
x = 'abcd'for i in range(x): print(i)
x = 'abcd'for i in range(len(x)): i.upper()print (x)
x = 'abcd'for i in range(len(x)): print(i.upper())
x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x)
[‘AB’, ‘CD’]
[‘ab’, ‘cd’, ‘AB’, ‘CD’]
[‘ab’, ‘cd’]
Infinite Loop
i = 0while i < 3: print(i) i += 1else: print(0)
0 1 2 3 0
0 1 2 0
i = 1while True: if i%2 == 0: break print(i) i += 2
1 2 3 4 5 6 …
1 3 5 7 9 11 … infinite time