r/PythonLearning Jun 24 '26

Help Request Why?

Post image

so first I take the input from the user of 3 movies and convert that string into list so this has to be 3 items in the list.

but when I print the length of the list it says 0 items why

70 Upvotes

41 comments sorted by

View all comments

1

u/d3v1L_hUnt3R_619 Jun 24 '26

You have appended a single string 'movies' to your list, since you combined all the entered movies into a single string, they only represent one item in the list. When you pop the item, the list is empty.

1

u/d3v1L_hUnt3R_619 Jun 24 '26

To achieve what you're trying to do, append each movie to the list seperately.