Ask coding questions

← Back to all posts
how can i solve the indentation error
pinkycheung (0)

https://repl.it/@pinkycheung/MatureImpossibleCommand

how can I solve the indentation error?

Commentshotnewtop
malvoliothegood (174)

There is no indentation error for me, but there are other errors.
1) grade is not initialised
2) The while expression is incorrect
3) There has to be an if if you are going to use an else

Here is some example code that may help you:

# ask the user for a grade and convert it to an integer using the int function
# as the input function returns a string
grade = int(input("Your grade? It has to be greater than 50: "))
# Loop will repeat until grade is over 50
while (grade <= 50):
  grade = int(input("Grade has to be greater than 50: "))

print("Cool, your grade is", grade)