CSC 171 - Introduction to Computer Programming

Lab Assignment #21 - Working With Lists

Due Monday, November 20, 2023

We have seen lists and a few list operations

Let’s say we have two lists:

mylist = [4, 2, [5, 6, 37], 13, 13, 29]

yourlist = ["socks", "pillowcases", "tablecloth", 34.5]

What are the results of the following operations?

  1. len(mylist)
  2. max(mylist[2])
  3. min(mylist[2])
  4. mylist[2][2]
  5. sum(mylist[2])
  6. mylist[2]*3
  7. yourlist[-2:]
  8. yourlist[0]
  9. "socks" in yourlist
  10. yourlist*3
  11. yourlist < ["socks", "pillows"]

[Back to the Lab Assignment List]