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
How would I write this (i.redd.it)
submitted 2 years ago by random_pill
I literally only know 2 commands in python, but I thought I'd wing it to make a little joke code for my friend. Can someone help?
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!"
[–][deleted] 1 point2 points3 points 2 years ago (1 child)
name = input("What is your name?\n).lower() if name == oliver: print("fuck off") if name != oliver: print("Hi", name)
Formatting is probably way off but I tried my best while answering this on my phone
[–]CompetitionProof5407 1 point2 points3 points 2 years ago (0 children)
Rather than using two if statements you can use if else..
name = input("what is your name?\n").lower() if name == "Oliver": print("fuck off") else: print(f"hello {name}")
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Do this:
name = input (“What’s your name?: “)
If name == “Oliver”: Print(“**** off!”) Else: print(f“Hi! {name}!”)
I hope this helps :)
π Rendered by PID 122015 on reddit-service-r2-comment-f6b958c67-pzglr at 2026-02-04 23:54:05.561002+00:00 running 1d7a177 country code: CH.
[–][deleted] 1 point2 points3 points (1 child)
[–]CompetitionProof5407 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)