codedex-io/python-101

Incorrect result in The Cyclone when line 13 is true

Closed this issue · 2 comments

Kids ride for free whoooo!

When height >= 100 and with_taller_person is True, this code doesn't check whether credits >= 10.

elif height >= 100 and with_taller_person:
print("Enjoy the ride!")


Code editor showing output "Enjoy the ride!" while credits = 0.

It looks like an easy fix is to move up lines 15-16 and place them at line 10 instead, so that credits are checked first before height. But maybe you don't want that, since it changes what the output is when the person is both too short and also doesn't have credits.

hey @caesiumtea thanks so much for flagging this! I just opened and connect PR #31 to this issue. Could you try out the new code and let me know if you find any more bugs? 🐛

I tried out the one in commit 6f33c40 and it seems like it's working! Though, the current code in commit 5245991 is back to giving the wrong answer.