30
25
20
50
What is the output of the following code?
print(True and False)
True
False
Error
None
55
60
555
1
0
infinite
5
ZeroDivisionError
4
8
16
32
What will the following code output?
a=5;b=7 b=a print(a,” ”,b)
5 7
7 5
5 5
7 7
a,b,c=3,5,6 b,c,a=a,b,c print(a,” ”,b,” ”,c)
3 5 6
6 3 5
5 6 3
6 5 3
a,b,c=3,5,6 b,c,a=a+1,b+2,c+3 print(a,” ”,b,” ”,c)
7 9 4
4 7 9
9 4 7
a=5 a*=10 print(a)
10
a=555 b=55 print( b in a)
TypeError
a=55 b=’55’ print( a is not b)
6
1.5
if (x > 0):
if x > 0
if x > 0 then:
Both A and B
To create an infinite loop.
To check additional conditions when the first if condition is False.
To end the if block.
To execute code unconditionally.
sequence()
range()
list()
loop()
It skips the current iteration and goes to the next iteration.
It terminates the loop entirely
It does nothing.
It restarts the loop.
Exits the loop entirely.
Skips the rest of the code in the current iteration and moves to the next iteration.
Restarts the loop.
Causes an error.
To execute if the loop terminates normally without a break.
To execute after every iteration..
To handle errors in the loop.
To terminate the loop.
Only the first condition is checked.
All conditions are checked, even if one is True.
It behaves the same as if-elif.
It raises an error.