Skip to content
← Back to Community
How do I fix this bug?
Profile icon
HarveyH

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.

Answered by CoolqB [earned 5 cycles]
View Answer
Voters
Profile icon
natecraft66
Profile icon
Hemerson1
Profile icon
Chomko2009
Profile icon
HarveyH
Comments
hotnewtop
Profile icon
CoolqB

Hi,

Your issue is that you're using input() rather than raw_input(). I'm not sure you're aware, but you're using Python2, not Python3. This means that input() acts as basically a calculator, typing in 3 + 1 into input() will return 4, whereas typing in 3 + 1 into raw_input() will return 3 + 1, which is what I assume you want :)

To fix this: Replace all instances of input with raw_input, and you should be good to go!
Alternatively you could switch to Python3 :)

Profile icon
Yamboy1

@CoolqB ooh, interesting. I must file that away for the future

Profile icon
CoolqB

@Yamboy1 Yep! input() was removed from Python3, however, since it was kind of confusing and it's easy to reproduce with eval(input()).

Profile icon
HarveyH

@CoolqB Thank you!

Profile icon
Yamboy1

Hi HarveyH

Can I have a link to the actual repl please?

Profile icon
CoolqB

@Yamboy1
After a bit of scraping around, I found this repl exactly matches the image, though take it with a grain of salt since I'm not the OP: https://repl.it/@HarveyH/MULTI-MATHS

Profile icon
HarveyH

@Yamboy1 Yeah, it is that one.

Profile icon
amasad

@HarveyH don't forget to upvote useful answers so they can get cycles

Profile icon
HarveyH

k!

Profile icon
HarveyH

Thank you guys! The bug is now fixed!