IT 116: Introduction to Scripting
Class 9 Ungraded Quiz

  1. In the loop below, what happens each time the boolean expression after the keyword while evaluates to true?
    while num < 10:
         num = num + 1



  2. If the value of the variable num is 0 before entering the loop above, how many times does the indented statement run?


  3. 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?


  4. What happens in a while loop when the boolean expression after the keyword while becomes false?


  5. What is unusual about the following code?
    num = 5
    while num > 0:
        print(num)



  6. What do you call a loop that does not stop?


  7. If you want to stop a Python script running on Unix, what do you do?


  8. Will a while loop with the following header ever stop?
    while True:



  9. What do you call the process of checking that a value entered by a user is correct?


  10. What do you call a statement that contains other statements?