TOPIC 5: Python Lists
Completion requirements
8. Exercises
Class Exercise
-
Create a list containing five fruits and print it.
-
Create a list containing five numbers and print it.
-
Create a list containing your name, age, and state.
-
Print the length of the following list:
cars = ["Toyota", "Honda", "BMW", "Ford"]
print(len(cars))
-
What is the output of the following code?
mylist = ["apple", "banana", "cherry"]
print(mylist[1])