Looking for trustworthy answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Get quick and reliable solutions to your questions from knowledgeable professionals on our comprehensive Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.
Sagot :
Answer:
See Explanation
Explanation:
This question requires more information because you didn't state what the program is expected to do.
Reading through the program, I can assume that you want to first print all movie titles then prompt the user for a number and then print the move title in that location.
So, the correction is as follows:
Rewrite the first line of the program i.e. movie_titles = ["The grinch......."]
for each_movie_titles in movie_titles:
print(each_movie_titles)
usernum = int(input("Number between 0 and 9 [inclusive]: "))
if usernum<10 and usernum>=0:
print(movie_titles[usernum])
Line by line explanation
This iterates through the movie_titles list
for each_movie_titles in movie_titles:
This prints each movie title
print(each_movie_titles)
This prompts the user for a number between 0 and 9
usernum = int(input("Number between 0 and 9 [inclusive]: "))
This checks for valid range
if usernum<10 and usernum>=0:
If number is valid, this prints the movie title in that location
print(movie_titles[usernum])
We hope our answers were helpful. Return anytime for more information and answers to any other questions you may have. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Keep exploring Westonci.ca for more insightful answers to your questions. We're here to help.