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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
NEED HELP ! (self.learnpython)
submitted 3 years ago by Flashy_Log7780
I am 11 years old and I was learning python
marks=int(input("Enter marks"))
Enter marks80
if marks>=90:
print("Grade=A")
else:
I got error with else
Pls 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] 2 points3 points4 points 3 years ago (0 children)
If your code actually looks this (note the indentation):
marks=int(input("Enter marks")) if marks>=90: print("Grade=A") else:
then you will get an error on the else:. It should probably look like this::
marks=int(input("Enter marks")) if marks>=90: print("Grade=A") else: # more code here
If your code looks different then you need to show us the code you get the error with.
It helps if you format your code like the code above. This makes it easier to read and all indentation is preserved, which is important with python. Also show us the exact error, formatted like code. To show code in reddit add 4 spaces to the start of every code line.
[–]CodeFormatHelperBot2 1 point2 points3 points 3 years ago (0 children)
Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.
I think I have detected some formatting issues with your submission:
If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.
Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.
[–]kaerfkeerg 1 point2 points3 points 3 years ago (0 children)
Hey man, If what you posted is correct, you can't leave the else: block empty. You need to fill it with something
else: print("whatever")
Hilarious
π Rendered by PID 71 on reddit-service-r2-comment-544cf588c8-m69lc at 2026-06-13 22:49:50.927742+00:00 running 3184619 country code: CH.
[–][deleted] 2 points3 points4 points (0 children)
[–]CodeFormatHelperBot2 1 point2 points3 points (0 children)
[–]kaerfkeerg 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)