Can someone plz help. I'm not getting any errors, but my code isn't working. It is only able to use the else command I have

Can someone plz help. I’m not getting any errors, but my code isn’t working. It is only able to use the else command I have.
https://www.codecademy.com/practice/projects/games-of-chance
Q no. 4
Cho-Han game

Here is my code so far:

import random

total_one = random.randint(1,6)
total_two = random.randint(1,6)
total = total_one + total_two
even = (2) or (4) or (6) or (8) or (10) or (12)
odd = (1) or (3) or (5) or (7) or (9) or (11)

def dice_roll (guess, bet):
money = 100
if (total == even) and (guess == even):
money = money + bet
print ("You won. Your total is now " + str(money))
if (total == even) and (guess == odd):
money = money + bet
print ("You lost. Your total is now " + str(money))
else:
money = money - bet
print ("You lost. Your total is now " + str(money))

dice_roll(odd, 30)

If even is equal to 2, then how can it at the same time be equal to 4? Which is it? What value does even have?

1 Like

Why don’t you use modulo (%) instead of a variable? For example:

if total % 2 == 0:
#code
else:
#code

Would that be better?

1 Like

Thanks for the help, i fixed the bug and the code now works.

1 Like

Thanks for the help about the modulo, once I implemented it into my code it worked much better.

1 Like

@flynn1234532 You’re welcome!
Happy coding!