Lets say I want to create a little program that asks for a user input of 1 through 10.
If that input is 1,3,5,7,9 the user wins
if the that input is 2,4,6,8 the user loses
I cannot figure out how to make a variable that contains all those integers.
I started with this:
If that input is 1,3,5,7,9 the user wins
if the that input is 2,4,6,8 the user loses
I cannot figure out how to make a variable that contains all those integers.
I started with this:
input_value = input("Enter value 1 through 10:") input_value = int(input_value) win_num = [1, 3, 5, 7, 9] if input_value == win_num: print("you win") else: print("you lose")I get you lose no matter the value I enter.