r/PythonLearning • u/Reh4n07_ • Jun 24 '26
Help Request Why?
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
68
Upvotes
1
u/Raftaar-01 Jun 24 '26
okay,
you create a list object named lst[]
then you took 3 strings as input one after another
then you just concate those strings by + operator
now your movies variables contains a string
then you append that string variable in that created list object
print() -> function will give you the list of string as shown in your terminal
then you use pop(index) -> this function pop out means take out the value from the list as i can see you did not store that poped out string into any variable python garbage collector soon remove it.
how you print list but your list contains nothing at this point
then you used len() -> function which gives you how many item does list contains but in your case the list doesn't contain anything so it will return you 0 (zero)
hope buddy you got it,
learn and scale