IT 116: Introduction to Scripting
Class 9 Ungraded Quiz
In the loop below, what happens each time the boolean expression after the keyword
while
evaluates to true?
while num < 10: num = num + 1
If the value of the variable
num
is 0 before entering the loop above, how many times does the indented statement run?
If the value of the variable
num
is 0 before entering the loop above, what is the value of the variable
num
after the loop stops running?
When does a
while
loop stop?
What is unusual about the following code?
num = 5 while num > 0: print(num)
What do you call a loop that does not stop?
If you want to stop a Python script running on Unix, what do you do?
Will a
while
loop with the following header ever stop?
while True:
What do you call the process of checking that a value entered by a user is correct?
What is a compound statement?