How do I fix this bug?
I have a bug in my game but I don't know how to fix...
This file cannot be displayed: https://storage.googleapis.com/replit/images/1535009103116_32af127a4ccee708c3ce55498df116d1.pn It is where you can type in the question to get the question right.
HarveyH
Thank you guys! The bug is now fixed!
Hi,
Your issue is that you're using
input()
rather thanraw_input()
. I'm not sure you're aware, but you're using Python2, not Python3. This means thatinput()
acts as basically a calculator, typing in3 + 1
intoinput()
will return4
, whereas typing in3 + 1
intoraw_input()
will return3 + 1
, which is what I assume you want :)To fix this: Replace all instances of
input
withraw_input
, and you should be good to go!Alternatively you could switch to Python3 :)
@CoolqB ooh, interesting. I must file that away for the future
@Yamboy1 Yep!
input()
was removed from Python3, however, since it was kind of confusing and it's easy to reproduce witheval(input())
.@CoolqB Thank you!