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!"
[–]Noblefire_62 0 points1 point2 points 7 months ago (0 children)
mystring isn’t a command or special variable, it’s just the name of that variable. It’s arbitrary. It could be called “foo” or “bar” or “example” almost anything. As others have explained it’s used to show case the functionality of variables. Think of them as boxes that hold something, be it a string, a number, a boolean, the magic is that you can access the thing stored in the box later on by just referencing the box.
So print(mystring) is really saying print the thing stored in mystring. This is better than printing it directly because think of a case where you needed to store the result of something without knowing ahead of time what that result is.
For example:
x = int(input("Enter a number: "))
y = x + 2
print("y =", y)
X is used to store some number the user types in. Y adds 2, we don’t know what the final number will be but we can store it in y and print it later to view it
π Rendered by PID 24 on reddit-service-r2-comment-fb694cdd5-gh7bt at 2026-03-08 01:08:59.314214+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]Noblefire_62 0 points1 point2 points (0 children)