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

  1. What do you call a collection of things stored one right after another?
    a sequence
  2. What is a list?
    a sequence object that can be changed
  3. What is a tuple?
    a sequence object that cannot be changed
  4. What do you call the individual values in a list?
    elements
  5. Do the values in a list all have to be of the same type?
    no
  6. What is the name of the list conversion function?
    list
  7. Write an assignment statement that creates an empty list and assigns it to the variable empty.
    empty = []
  8. Write an assignment statement that creates a list of the first 5 integers and assigns it to the variable l1.
    l1 = [1, 2, 3, 4, 5]
  9. What expression would you write to get the number of values in the list l1?
    len(l1)
  10. What list method would you use to add a value to the end of a list?
    append