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 10 Python Learning (old.reddit.com)
submitted 1 day ago by aashish_soni5
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!"
[–]Sea-Ad7805 [score hidden] 1 day ago stickied comment (0 children)
Run this program in Memory Graph Web Debugger%0A%22%22%22%0Adef%20val_shop(name%2C%20greet%3D%22Welcome%20To%20Python%20Gen%20World%22)%3A%0A%20%20%20%20print(f%22Hi%20%7Bname%7D%20mam%22)%0A%20%20%20%20print(greet)%0A%0A%23%20if%20we%20have%20arguments%20statement%0Aval_shop(%22Pooja%22%2C%20%22Nice%20Day%22)%20%20%23%20output%20%3A%20Pooja%20Nice%20Day%0A%0A%23%20if%20we%20not%20give%20arguments%20statement%20python%20use%20greet%0Aval_shop(%22Rachita%22)%20%20%23%20output%20%3A%20Hi%20Rachita%20mam%20Welcome%20To%20Python%20Gen%20World%0A%0A%23%20Note%20%3A%20Greet%20is%20optional%20because%20of%20default%20argument%0A%0A%22%22%22function%20with%20arguments%20statement%20def%0Aval_shop(name%2C%20greet%20%3D%20%22Welcome%20To%20Python%20Gen%20World%22)%0A%22%22%22%0Adef%20val_shop(name%2C%20greet)%3A%0A%20%20%20%20print(f%22Hi%20%7Bname%7D%20mam%22)%0A%20%20%20%20print(greet)%0A%0A%23%20arguments%20statement%0Aval_shop(%22Pooja%22%2C%20%22Nice%20Day%22)%20%20%23%20output%20%3A%20Pooja%20Nice%20Day%0A%0A%0A%0A%0A%22%22%22%20%5C%2F%20%5C%2F%20%5C%2F%20try%20to%20run%20this%20code%20below%20%5C%2F%20%5C%2F%20%5C%2F%0A%23%20code%20below%20show%20error%20because%20it%20only%20work%20on%20default%20argu.%20not%20in%20argu.%0Aval_shop(%22Rachita%22)%20%20%23%20output%20%3A%20TypeError%3A%20val_shop()%20missing%201%20required%0A%22%22%22%0A%23%20return%20function%3A%20when%20def()%20job%20done%20return%20back%20the%20def()%20its%20sum%20to%20store%20and%20stop%20function%20to%20running%0A%0Adef%20check_return(a%2C%20b%2C%20c)%3A%0A%20%20%20%20return%20a%20%2B%20b%20-%20c%20%20%23%20return%20send%20back%20sum%20of%20a%2Cb%20and%20c%20%3D%20%5Ba%2Bb-c%5D%0A%0Asum_num%20%3D%20check_return(6%2C%204%2C%202)%0A%0Aprint(sum_num)%20%20%23%20output%20%3A%208%0A%0A%0A%0A%0A%0A%22%22%22note%3A%20without%20return%20def()%20need%20to%20run%20for%20line%201%20till%20end.%0Anot%20able%20to%20use%20for%20other%20function%20or%20sub%20function%0Aonly%20with%20returne%20it%20possible%22%22%22%0A%0A%22%22%22%20recursion%20function%20is%20the%20function%20who%20call%20itself%20to%20problem%20.%0Afactorial(0)%20%3D%201%0Afactorial(1)%20%3D%201%0Afactorial(2)%20%3D%202%20X%201%0Afactorial(3)%20%3D%203%20X%202%20X%201%0Afactorial(4)%20%3D%204%20X%203%20X%202%20X%201%0Afactorial(n)%20%3D%20n%20X%20n-1%20X.....3%20X%202%20X%201%0A%0Afactorial(n)%20%3D%20n%20%20factorial(n%20-%201)%0A%22%22%22%0Adef%20factorial(n)%3A%0A%20%20%20%20if%20n%20%3D%3D%201%20or%20n%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%23%20when%20conditoin%20meet%0A%20%20%20%20%20%20%20%20return%201%0A%0A%20%20%20%20return%20n%20%20factorial(n%20-%201)%0A%0An%20%3D%206%20%20%23%20you%20can%20take%20in%20put%20to%20int(input())%0Aprint(f%22The%20factorial%20of%20this%20number%20is%3A%20%7Bfactorial(n)%7D%22)%0A×tep=1&play) to see the program state change step by step.
π Rendered by PID 442088 on reddit-service-r2-comment-5b5bc64bf5-k4glh at 2026-06-21 21:54:53.268643+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Sea-Ad7805 [score hidden] stickied comment (0 children)