8. Exercises

Class Exercise

  1. Create a list containing five fruits and print it.

  2. Create a list containing five numbers and print it.

  3. Create a list containing your name, age, and state.

  4. Print the length of the following list:

cars = ["Toyota", "Honda", "BMW", "Ford"]
print(len(cars))
  1. What is the output of the following code?

mylist = ["apple", "banana", "cherry"]
print(mylist[1])