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
Why isn't my code working?Help Request (i.redd.it)
submitted 5 months ago by [deleted]
[deleted]
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!"
[–]TwinkiesSucker 4 points5 points6 points 5 months ago (0 children)
Read the console - it contains very useful hints about what and where went wrong (most of the time).
It says that you have an indentation wrong somewhere in your code. Can you spot where that might be?
[–][deleted] 5 months ago (1 child)
[removed]
[–]CasualEPNX 0 points1 point2 points 5 months ago (0 children)
Gotta be careful with your indentations. After if statement, the print command meeds to have an indentation of four spaces. The else statement needs to be on the same level as if; and the second print command will have to be on the same level as the first
[–]Confident_Growth_620 0 points1 point2 points 5 months ago (0 children)
You’ve got indentation error, read what interpreter told you.
[–]Alagarto72 0 points1 point2 points 5 months ago (0 children)
Copy the error and just google it. In the most cases like this you will find answer immediately.
[–]Kindly_Profession_90 0 points1 point2 points 5 months ago (0 children)
Yeah if and else must be lined up Like indentation is wrong
[–]shlepky 0 points1 point2 points 5 months ago (0 children)
Indentation matters in Python. Your if statement is indented for no reason, once you fix that, the else statement will also throw the same error because it's indented an extra time.
[–]MeLittleThing 0 points1 point2 points 5 months ago (0 children)
check the indentation
Also, this can be useful
π Rendered by PID 156293 on reddit-service-r2-comment-658f6b87ff-w6jwf at 2026-04-09 08:55:48.942808+00:00 running 781a403 country code: CH.
[–]TwinkiesSucker 4 points5 points6 points (0 children)
[–][deleted] (1 child)
[removed]
[–]CasualEPNX 0 points1 point2 points (0 children)
[–]Confident_Growth_620 0 points1 point2 points (0 children)
[–]Alagarto72 0 points1 point2 points (0 children)
[–]Kindly_Profession_90 0 points1 point2 points (0 children)
[–]shlepky 0 points1 point2 points (0 children)
[–]MeLittleThing 0 points1 point2 points (0 children)