0
if else problem
# ı was trying run this code, but it is not starting. WHY ? :( grade = 70 if (grade >= 70 or grade <=100): print("Passed!") else: if(grade >= 0 or grade < 70 ): print("Fail") # I am new programmer
1 Réponse
+ 1
ERROR IS SHOWN BELOW:
File "<string>", line 4
else:
^
IndentationError: unindent does not match any outer indentation level
SO... This is an indentation error the if and else should be indented with equal spaces (indentation is the distance between the left margin and the code).
THIS CODE WILL WORK:
grade = 70
if (grade >= 70 or grade <=100):
print("Passed!")
else:
if (grade >= 0 or grade < 70 ):
print("Fail")
# I am new programmer
THE SIXTH LINE ALSO,SHOULD BE INDENTED ! LIKE AFTER IF STARTED WE NEED TO GIVE A LITTLE MORE DISTANCE FOR THE CODE INSIDE THE IF.