so Well I was trying to do some python for an trivia Game But It Showed Me and error Called:
IndentationError: expected an indented block after ‘if’ statement on line 8
Its giving me this error and I need a Fix for This I need Help please here is the python:
print('Welcome To Minecraft Trivia!')
ans = input('are you ready to play (yes/no):')
score = 0
total_q = 5
if ans.lower() == 'yes':
ans = input('1. Who Was The Original creator of Minecraft? (First name)')
if ans.lower() == 'Notch':
score += 1
print('Correct Bravo!')
else:
print('boo Thats incorrect')
>Solution :
As the error states, the problem is the indentation at the line specified. You should indent the code inside the second if
print('Welcome To Minecraft Trivia!')
ans = input('are you ready to play (yes/no):')
score = 0
total_q = 5
if ans.lower() == 'yes':
ans = input('1. Who Was The Original creator of Minecraft? (First name)')
if ans.lower() == 'Notch':
score += 1
print('Correct Bravo!')
else:
print('boo Thats incorrect')