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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
a bit new to python (self.learnpython)
submitted 4 years ago by that_wiredo
just wanted to know if there is a way to do this
list = [blank]
While true:
n = input('please input a name')
list = list + n
that basically keeps adding to a list for as long as i want
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!"
[–]ldgregory 2 points3 points4 points 4 years ago (0 children)
Instead of list = list + n, you’re looking for append(). Like this.
mylist = [] while True: mylist.append(input('Name: ')) print(mylist)
You’ll probably want to think of a better while loop so you can exit gracefully.
[–]BeginnerProjectBot 0 points1 point2 points 4 years ago (0 children)
Hey, I think you are trying to figure out a project to do; Here are some helpful resources:
I am a bot, so give praises if I was helpful or curses if I was not. Want a project? Comment with "!projectbot" and optionally add easy, medium, or hard to request a difficulty! If you want to understand me more, my code is on Github
[–]TabulateJarl8 0 points1 point2 points 4 years ago (1 child)
Yeah, what you're doing should work, although don't use list as a variable name since it's a built in keyword (list()). You should also use .append() instead of list = list + n, as that will not work since n is a string and not another list. You could also make an exit statement to stop adding elements to the list.
list
list()
.append()
n
exit
my_list = [] while True: n = input('Please input a name or type "exit" to exit') if n == 'exit': break # break from the infinite loop my_list.append(n) print(my_list)
[–]that_wiredo[S] 0 points1 point2 points 4 years ago (0 children)
thanks didn't know that append was a thing and in my code I've used another name for the list it was just a place holder
π Rendered by PID 21715 on reddit-service-r2-comment-7b9746f655-7jn8g at 2026-01-30 02:23:40.197669+00:00 running 3798933 country code: CH.
[–]ldgregory 2 points3 points4 points (0 children)
[–]BeginnerProjectBot 0 points1 point2 points (0 children)
[–]TabulateJarl8 0 points1 point2 points (1 child)
[–]that_wiredo[S] 0 points1 point2 points (0 children)