# I need help with a script that doesn't seem to work!

I am making a gambling script in Python and it seems to always throw out the same answer, thank you for help. The coin flip script seems to work but the other one doesn't. Sorry if this seems like a stupid question I am new to this.

Script:

#START

a = random.randint(1, 2)

cc = random.randint(1, 12)

#COINFLIP MINIGAME

def coin_flip(side, bet):

if a == 1 and side == "Heads":

return "Heads, you won " + str(bet * 2) + " dollars!"

elif a == 1 and side == "Tails":

return "Heads, you lost " + str(bet) + " dollars!"

elif a == 2 and side == "Tails":

return "Tails, you won " + str(bet * 2) + " dollars!"

elif a == 2 and side == "Heads":

return "Tails, you lost " + str(bet) + " dollars!"

#DICE MINIGAME

def gamble(side, bet):

if cc == odd_numbers and side == "Odd":

return "Odd, you won " + str(bet * 2) + " dollars!"

elif cc == odd_numbers and side == "Even":

return "Odd, you lost " + str(bet) + " dollars!"

elif cc == 2 or 4 or 6 or 8 or 10 or 12 and side == "Even":

return "Even, you won " + str(bet * 2) + " dollars!"

elif cc == 2 or 4 or 6 or 8 or 10 or 12 and side == "Odd":

return "Even, you lost " + str(bet) + " dollars!"

print(coin_flip("Heads", 555))

print(gamble("odd", 20))

Your error is that you put some "and" and "or" statements in quotes

a = random.randint(1, 2)

cc = random.randint(1, 12)

#COINFLIP MINIGAME

def coin_flip(side, bet):

if a == 1 and side == "Heads":

return "Heads, you won " + str(bet + 2) + " dollars!"

elif a == 1 and side == "Tails":

return "Heads, you lost " + str(bet) + " dollars!"

elif a == 2 and side == "Tails":

return "Tails, you won " + str(bet + 2 ) + " dollars!"

elif a == 2 and side == "Heads":

return "Tails, you lost " + str(bet) + " dollars!"

#take note that when you have a " : " you have to indent the next line

Still need help

a little further up where I didn't copy there is "import random" and ignore the odd numbers thing it's supposed to be " 1 or 3 or 5 or 7 or 9 or 11

Sorry the code kind of removed the spacing in the beginning. all the spacing is right in the code btw

Also the (bet 2) is actually (bet * 2).

May you link the repl you are working in? I may be able to get a better look !

@Bobo48What is the issue exactly?

@Bobo48
Can you add the repl pls?