Ask coding questions

← Back to all posts
can you please help fix the error EOF
Agzamikail (2)

can you please help fix the error EOF

HELP

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