Font size
WorksheetsLOOPS AND FLOW CONTROL STATEMENTS
Total questions: 10
Worksheet time: 9mins
Code for
Five is greater than two!
if 5 > 2:
print("Five is greater than two!")
if 5 = 2:
print("Five is greater than two!")
if 5 > 2: Print("Five is greater than two!")
Code for
257
Hello, World!
x = 257
y = "Hello, World!"
print(y)
print(x)
x = 257
y = "Hello, World!"
print(x)
print(y)
x = 257
y = Hello, World!
print x
print y
print("Hello" + "world" + "today")
The result of this program:
Friday = False
if Friday:
print "Jeans day!"
else:
print "Uniform day"
Jeans day
Today is Friday
Uniform day
Not Friday
An empty/null statement in python is ____________
go
pass
over
;
What is the output of the above program ?
Am I here?
Or here ?
Am I here ? Or here ?
Or here ? Or over here ?
If the user inputs : 2<Enter> , what does the following code snippet print ?
Yes
No
May be
Nothing printed
Error
In for a in _________ : , the blank can be filled with
an iterable sequence
a range() function
a single value
an expression
Consider the following loop given below :
for i in range(5):
print(i)
How many times will this loop run ?
5
0
infinite
Error
