WorksheetsFlow of Control
Total questions: 18
Worksheet time: 9mins
In a Python program , a control structure:
directs the order of execution of the statements in the program
dictates what happens before te program starts and after it terminates
defines program-specific data structures
manages the input and output of control characters
An empty/null statement in python is ____________
go
pass
over
;
The order of statement execution in the form of top to bottom , is known as ______ construct
selection
repetition
sequence
flow
The ___________ construct allows to choose statements to be executed , depending upon the result of a condition.
selection
repetition
sequence
flow
Which of the following statements will make a selection construct ?
if
for
if-else
while
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
Function range(3) is equivalent to "
range(1,3)
range(0,3)
range(0,3,1)
range(1,3,0)
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
The program snippet above is syntactically correct
False
True
You should be at least 18 years to vote. What should be the expression in the if statement that will print
can vote.
age >= 18
age = 18
age == 18
What is the output of the program above.
can vote
can drink
can vote can drink
What is the output of the above program
can vote
can drink
can vote
can drink
none of the above
What is the output of the above program
can vote
can drink
can vote
can drink
none of the above
What is the output of the code above
go watch cartoons
can vote
go get a girlfriend/boyfriend
The program above will print
Nothing
tends to drink
tends to chitchat
The code above will print
python
java
None
