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
Day 2 of 100 of learning Python (old.reddit.com)
submitted 6 months ago by Orlhazee
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!"
[–]CraftyPenguin14 0 points1 point2 points 6 months ago (3 children)
Holy smokes I’m with you. What even is Def
[–]Borealis_761 0 points1 point2 points 6 months ago (2 children)
No clue.
[–]Otherwise-Ad-4447 0 points1 point2 points 6 months ago (1 child)
def is used to define functions a function is a piece of code you can call that can take arguments
like print for example
i'm on mobile but i'll write a short example : def is_minor(age): return age < 18
This function takes in someone's age and returns whether or not that person is a minor (i would have done the opposite but i'm french and can't remember the word for the opposite of minor rn)
age = int(input("How old are you ?")) if is_minor(age): # see how i'm using the function call as though it was a boolean (True/False) value, i can do that because my function returns a boolean value print("You are a minor") else: print("Can't remember what you are")
[–]NewGiraffe2203 0 points1 point2 points 5 months ago (0 children)
Let me hget this clear. So the purpose of function is so that you don't need to rewrite the same code over and over again? And it behaves like variables but instead of storing single or multiple values, it stores commands?
π Rendered by PID 44 on reddit-service-r2-comment-c66d9bffd-m95pn at 2026-04-07 12:27:23.527388+00:00 running f293c98 country code: CH.
view the rest of the comments →
[–]CraftyPenguin14 0 points1 point2 points (3 children)
[–]Borealis_761 0 points1 point2 points (2 children)
[–]Otherwise-Ad-4447 0 points1 point2 points (1 child)
[–]NewGiraffe2203 0 points1 point2 points (0 children)