Assessment --- Python lists

May 21, 2014 • Tim McNamara

Assessment drawn from Christian Jacobs’ concept map.

What are some features of Python’s lists?

a) Ordered sequence, arbitrary type, mutability
b) Arbitrary sequence, fixed type, mutability
c) Arbitrary sequence, arbitrary type, mutability
d) Ordered sequence, arbitrary type, immutability
e) Arbitrary sequence, fixed type, immutability

Suppose we have a list cities, what do we do if we wanted to select the first city?

a) first(cities)
b) cities[0]
c) cities1
d) cities.first()