Question: Python Python Exercise 1 . Lists: Create a list of 5 of your favorite movies. Access the third movie in the list. Solution for Exercise
Python
Python
Exercise Lists: Create a list of of your favorite movies. Access the third movie in the list.
Solution for Exercise :
movies Movie "Movie "Movie "Movie "Movie
printmovies
Exercise Modification: Add another movie to the list and then remove the second movie.
Solution for Exercise :
movies.appendMovie
del movies
Exercise Tuples: Create a tuple of cities you'd love to visit. Why can't you change the second city?
Solution for Exercise :
cities Paris "Tokyo", "Nairobi"
# cities "Berlin" # This would raise an error since tuples are immutable.
Exercise Operations: For both your list and tuple, determine their lengths.
Solution for Exercise :
nummovies lenmovies
printnummovies
numcities len
printnumcities
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
