Font size
WorksheetsPython Control Structure
Total questions: 15
Worksheet time: 8mins
for word in "Jump Statement":
if word == "_": ------------> 1
_____--------------------> 2
print (word, end='')
Choose the correct option to fill the missing values(1,2) in the above code to get the below output
Jup Stateent
mm,break
mm,continue
m,break
m,continue
Predict the output of following code
for word in "Jump Statement":
if word == "e":
continue
print (word, end='')
Jump Statement
Jump Statmnt
Jump
Statmnt
What is the output of the following code?
for word in "Jump Statement":
if word == "u":
break
print (word, end='')
Jump Statement
Jump
J
Ju
What is the output of the following snippet?
i=1
while True:
if i%3 ==0:
break
print(i,end='')
i +=1
12
123
1234
124
Predict the output of following code
i=0
while (i<=10):
for j in range (0,i,2):
print (j,end='\t')
print (end='\n')
i +=2
0
0 2
0 2 4
0 2 4 6
0 2 4 6 8
0 2 4 6 8 10
0
0 2
0 2 4
0 2 4 6
0 2 4 6 8 10
0
0 2
0 2 4
0 2 4 6
0 2 4 6 8
no output
Which of the following jump statement is used to terminate the loop?
continue
goto
pass
break
Which amongst this is not a jump statement ?
for
break
continue
pass
Is it possible place while loop inside a for loop and vice versa?
yes
no
impossible
may be
Which of the following nested loops are valid?
while within while
for within for
while within for
for within while
Which of the following function is used in python for loop to specify the initial, final and increment values?
range
format
input
What plays a vital role in Python programming?
Statements
Structure
Control
Indentation
Which statement is generally used as a placeholder?
continue
pass
break
goto
The condition in the statement should be in the form of
Arithmetic r relational expression
Arithmetic or Logical expression
Relational or Logical expression
Arithmetic
_____ statement is used to skip the remaining part of the loop and start with next iteration.
Pass
break
continue
range
____ statement in Python programming is a null statement.
continue
pass
break
for
