0

I'm writing a code that continuously asks the user to input movie titles to a list then prints the list but breaks when the user types in "done" and i can't figure out how to keep asking the user for inputs and still prints all the titles after

movie_list = []

while True:
    title = input("Add movie title or type done if finished: ")
if title == "done":
    break
movie_list.append(title)
print(movie_list)
Megan
  • 1
  • 1
  • Your indentation is messed up. The lines from `if` to `movie_list.append` should be indented inside the `while` loop. – Barmar Mar 26 '21 at 02:15
  • Hi Megan. Indentation is import in Python, as it defines the "basic blocks" of the program. You need to move the logic of your while loop inside of it by using indentation. If you're unsure of how to do this, please see the duplicate question I linked! – Christian Dean Mar 26 '21 at 02:19

0 Answers0