IT 116: Introduction to Scripting
Class 7 Ungraded Quiz

  1. Write an if statement that prints "Too big" if the value of the variable number is greater than 100.


  2. What are the only values that a boolean expression can have?


  3. Write the Python boolean literals.


  4. Write the boolean expression that is true if the value of the variable number_1 is greater than or equal to value of the variable number_2.


  5. Write an if statement that prints "Too big" if the value of the variable numb is greater than 1000.


  6. Write an if/else statement that prints "Positive" if the value of the variable numb is greater than or equal to 0, and prints "Negative" if it is not.


  7. Write an if/elif/else statement that prints "Positive" if the value of the variable numb is greater than 0, and prints "Negative" if it is less than 0 and print "Zero" otherwise.


  8. If you typed the following in the Python interactive mode, what would the result be?
    "foo" < "bar"



  9. If you typed the following in the Python interactive mode, what would the result be?
    "sam" == "Sam"



  10. If you typed the following in the Python interactive mode, what would the result be?
    5 != 6