Py4e: Chapter 3 Questions and Answers|
Latest Update
What is the Python reserved word that we use in two-way if tests to indicate the block of code
that is to be executed if the logical test is false? Correct Ans-else
What will the following code print out?
x=0
if x < 2 :
print('Small')
elif x < 10 :
print('Medium')
else :
print('LARGE')
print('All done') Correct Ans-Small
All done
For the following code,
if x < 2 :
print('Below 2')
elif x >= 2 :
print('Two or more')
else :
Latest Update
What is the Python reserved word that we use in two-way if tests to indicate the block of code
that is to be executed if the logical test is false? Correct Ans-else
What will the following code print out?
x=0
if x < 2 :
print('Small')
elif x < 10 :
print('Medium')
else :
print('LARGE')
print('All done') Correct Ans-Small
All done
For the following code,
if x < 2 :
print('Below 2')
elif x >= 2 :
print('Two or more')
else :