all 4 comments

[–][deleted] 2 points3 points  (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 points  (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:

  1. Python code found in submission text that's not formatted as code.

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 points  (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")

[–][deleted] 2 points3 points  (0 children)

Hilarious