IT 117: Intermediate to Scripting
Class 3 Ungraded Quiz

  1. What are the four types of expressions?
    literals, variables, calculations with operators and function calls
  2. What is the name of the function used to get a value from the user?
    input
  3. Where does the loop variable in a for loop get its values?
    from the list following the keyword in
  4. When does a while loop stop running?
    when the expression after while becomes false
  5. How many arguments does the range function take?
    one, two or three
  6. What arguments would you give range to get the odd numbers from 1 to 5?
    1,6,2
  7. Write the header for the function work that takes parameters min and max.
    def work(min,max):
  8. What statement allows a function to return a value to the function call.
    return statement 
  9. Write the Python statement to create a file object for reading on the file students.csv
    file = open("students.csv", "r")
  10. Write a for loop that uses the file object file to print the lines in that file.
    for line in file:
        print(line)