IT 116: Introduction to Scripting
Quiz 9 Answers

  1. What do you all 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. Write an assignment statement that creates empty list list and assigns it to the variable list_1.
    list_1 = []
  5. Write an assignment statement that creates a list of the first 5 integers and assigns it to the variable list_1.
    list_1 = [1, 2, 3, 4, 5]
  6. Write an assignment statement that assigns the value of the third element of the list pointed to by the variable list_1 to the variable result.
    result = list_1[2]
  7. Write a Python statement to add 6 to the list list_1.
    list_1.append(6)
  8. Write a Python statement that sorts the list list_1.
    list_1.sort()
  9. Write a Python statement that sorts the list list_1 in reverse order.
    list_1.reverse()
  10. Write a Python expression that gives the smallest value in the list list_1.
    min(list_1)