Share your repls and programming experiences

← Back to all posts
1-8 Gambling
EliMolzahn (10)

Almost impossible to win:) yeet

ThunderCoder (3)

in line 18:
if int(heat) < 0:
print("you must bet more than that")
the = not True
you probably don't want people gambling for free so you should change it to

if int(heat)<=0

when I input no to: would you like to gamble?
it makes me gamble anyway for 1? is that fair? 😉

great program!

NathanThornberr (1)

I FOUND IT! i have won over 5 times! yeet

AgastyaSandhuja (168)

you should do random.randint(1,8) instead of random.choice(ea)

lightningrock (146)

Easy, won on first try.

dhower (0)

first try

bet 100, win 500. gambling is fun

Thecrowbar1234 (140)

I won on my second try
technically it was my first try because the first time i said y instead of yes so then I got an error

SBCKing (11)

Why did you import string? what was the point of that?

UzayAnil (22)

I FINALLY WON!!!!!!!!!!!!!!!!!!!!!!!!!!! (It took me 8 minutes)

SBCKing (11)

@EliMolzahn @PowerCoder you need to initialise the variable heat outside the while loop first like heat = 0. Also do heat = int(input('blah blah...') instead so you don't have to convert the input into an integer every time you want to use it(line14)