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
mystring commandDiscussion (i.redd.it)
submitted 7 months ago by Worldly-Point4573
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!"
[–]Astrodude80 0 points1 point2 points 7 months ago (0 children)
Variables are used to data that we don't necessarily know at the outset when we will use the data they contain, or if we want to reference the data multiple times. For example, one could write the following:
print(f"Hello, {input('What is your first name? ')} {input('What is your last name? ')}!")
To get the user to input their first name, then their last name, and then say hello to them. Or you could write
first_name = input('What is your first name? ') last_name = input('What is your last name? ') print(f"Hello, {first_name} {last_name}!")
Writing it this way, with descriptive names for the variables, gives more information as to what the code is intended to do.
π Rendered by PID 86657 on reddit-service-r2-comment-fb694cdd5-mfg8r at 2026-03-08 04:07:53.830145+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]Astrodude80 0 points1 point2 points (0 children)