IT 116: Introduction to Scripting
Answers to Class 8 Ungraded Quiz

  1. Write a Python expression that evaluates to True if the variable whose name is num has a value greater than 0 and less than 10.
    num > 0  and num < 10
  2. Write a Python expression that evaluates to True if the variable whose name is num has a value greater than or equal to 0 and less than or equal to 10.
    num >= 0  and num <= 10
  3. What is the data type of the variable whose name is value_good that is created by the following statement?
    value_good = num > 0
    boolean
  4. What is the boolean value of the following expression?
    5 and 0
    False
  5. What is the boolean value of the following expression?
    "a" or ""
    True
  6. What is the boolean value of the following expression?
    not 5
    False
  7. If you typed the following in Python's interactive mode, what would the result be?
    not False
    True
  8. If you typed the following in Python's interactive mode, what would the result be?
    True and False
    False
  9. If you typed the following in Python's interactive mode, what would the result be?
    True or False
    True
  10. If you typed the following in Python's interactive mode, what would the result be?
    not True
    False