0
answer = int(raw_input("How many hours a day do you play computer games? ")) 
if answer < 2: 
print "That seems a fairly healthy balance. Well done!" 
elif: 
print "You’re probably good enough by now with all that practice."
print "PS5 are better than any game console" 

Errors keep popping up that says "There's an error in your program: expected an indented block"

1 Answers1

1

When you code in python you have to indent the code otherwise you'll get the errors like you got. Other programming languages use ; such as php or java in order to differentiate the lines to execute, but in python we have the indentations. Besides, you can't use elif statement without some condition and if you don't have it you have to use else instead.

answer = int(raw_input("How many hours a day do you play computer games? ")) 

if answer < 2: 
  print "That seems a fairly healthy balance. Well done!" 

else: # instead of elif, which requires a condition
  print "You’re probably good enough by now with all that practice."
  print "PS5 are better than any game console" 
wallyk
  • 56,922
  • 16
  • 83
  • 148
Brad Figueroa
  • 869
  • 6
  • 15