Help with Games of Chance project

Whta’s up Codecademy peepz :smiley:

So I’m working on my “Game of Chances project” and I wanted to know if anyone out-there knows how can I make my second ‘if statement’ equal to an integer that it is still to be selected/define ?

I wrote what I want to do in UPPER CASES , to make it easier to understand what I want to accomplish.

Thanks in advance :smiley:

def roul(bet, choice):
    color =["Red", "Black"]
    color_result = random.choice(color)
    number = random.randint(0,37)
    if bet > 0 and money > 0:
        print("Please place you bet.")
        print("You bet $" + str(bet))
        print("No more bets.")
    if (choice == "Red") or (choice =="Black") or **(CHOICE == INTR())** or (choice == "Even") or (choice == "Odd"):
    print("You bet on: " + choice)

The variable has to be defined before it’s evaluated. You can set a function parameter default if you want, and that way it’ll run even when there are no values.

Then, when you invoke your function, if you have those special inputs you can pass them in there.

def roul(bet, choice, other=0):
  #your code


some_input = input("please enter input: ")
roul(10, "Red", other=some_input)

** note i fixed the last line


Super!! that is very helpful , thank you very much :smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.