Ask coding questions

← Back to all posts
help fix the error
Agzamikail (2)

Help fix the error EOF
Help

Answered by RYANTADIPARTHI (6006) [earned 5 cycles]
View Answer
Comments
hotnewtop
RYANTADIPARTHI (6006)

Solution

you are getting this error because you have no except block. Everytime you use a try, you need except.

try:
      if money>100 :
        money -= 100
        gold += 1
        print("money: "+str(money) + '$')
        print("gold : "+str(gold))
      if money<100 :
        print('not enough money')
        print("money: "+str(money) + '$')
        print("gold : "+str(gold))
except:
      print("something")

like that.
That should work