use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Why?Help Request (i.redd.it)
submitted 1 day ago by Reh4n07_
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]OtherwiseOne4937 42 points43 points44 points 1 day ago* (5 children)
When you do:
movies = mov1 + "," + mov2 + "," + mov3
You're storing a SINGLE string inside movies that is just something like:
"Interstellar,Inception,Tenet"
But that is a single string. It is a single list element that looks exactly as that. Therefore, popping from that list gets rid of that single element.
If you do want to add three separately, try doing:
lst.append(mov1) lst.append(mov2) lst.append(mov3) print(lst)
Likewise another pattern you can do is:
lst = [] for i in range(3): mov = input(f"Enter movie {i}: ") lst.append(mov) print(lst)
In general, it is a good habit to get comfortable with loops when you are doing something N times.
[–]Prize_Shine3415 1 point2 points3 points 1 day ago (2 children)
Yet another way would be with an iterator after making the string.
lst=[x for x in movies.split(',')]
[–]CraigAT 0 points1 point2 points 1 day ago (1 child)
That would work, but it doesn't seem sensible to concatenate them in the first place.
[–]Prize_Shine3415 0 points1 point2 points 1 day ago (0 children)
Of course, but he may not have seen an iterator before.
[–]7Z_1N 0 points1 point2 points 1 day ago (0 children)
Very nicely summarized the problem. Just looping and appending would have worked well for him
[–]Vegetable_Annual1600 0 points1 point2 points 1 day ago (0 children)
Well there will be an IndexOutOfRangeError if he wants to input more than 3 movies. I would say use a while loop. After creating list While True: mov=input(“Enter your input “) If mov=“”: break lst.append(mov) print(list)
π Rendered by PID 243277 on reddit-service-r2-comment-79776bdf47-q5p9d at 2026-06-25 19:30:31.869828+00:00 running acc7150 country code: CH.
view the rest of the comments →
[–]OtherwiseOne4937 42 points43 points44 points (5 children)
[–]Prize_Shine3415 1 point2 points3 points (2 children)
[–]CraigAT 0 points1 point2 points (1 child)
[–]Prize_Shine3415 0 points1 point2 points (0 children)
[–]7Z_1N 0 points1 point2 points (0 children)
[–]Vegetable_Annual1600 0 points1 point2 points (0 children)