2nd Semester Intro to Computer Science

Do Now 4.04

In your Console

Type and run the following code

# my_building is a representation of the apartments on each floor of my 3 story building
my_building = [
['apt1a', 'apt1b', 'apt1c'],
['apt2a', 'apt2b', 'apt2c'],
['apt3a', 'apt3b', 'apt3c']
]
print("first floor: " + str(my_building[0]))
print("first floor, 3rd apartment: " + str(my_building[0][2]))

In your Notebook

Respond to the following

  1. Write down what was printed.
  2. How you would access the 2nd apartment of the 3rd floor (apt3b)?

Edit this page Report an issue