Apr-13-2020, 07:17 AM
So I need to make a power ball list heres the details
Write a program that simulates a mini game of powerball. In this game, a ticket consists of 3 unique numbers between 1 and 9 and a 4th 'powerball' number between 1 and 3. A random drawing is done and the winnings are as follows:
One correct number wins $1, two numbers correct wins $10, three correct numbers win $100. If the Powerball number is correct, it multiplies the winnings by 2, unless all three numbers and the Powerball number are correct, in that case, a jackpot of $1000 is won.
So I have the code that allows me to enter the statements but my issue is I can't seem to figure out how to edit it so that I can change it to set number for each input like I need my 1-3 inputs to be set choices of 1,9 and my 4th input to be a set choice of 1,3 but I don't even see any way to edit that part and theres no print statements to edit the list names there all just number 1 number 2 number 3 and number 4 so any advice on that would really help me so I can finish this program thanks
Write a program that simulates a mini game of powerball. In this game, a ticket consists of 3 unique numbers between 1 and 9 and a 4th 'powerball' number between 1 and 3. A random drawing is done and the winnings are as follows:
One correct number wins $1, two numbers correct wins $10, three correct numbers win $100. If the Powerball number is correct, it multiplies the winnings by 2, unless all three numbers and the Powerball number are correct, in that case, a jackpot of $1000 is won.
So I have the code that allows me to enter the statements but my issue is I can't seem to figure out how to edit it so that I can change it to set number for each input like I need my 1-3 inputs to be set choices of 1,9 and my 4th input to be a set choice of 1,3 but I don't even see any way to edit that part and theres no print statements to edit the list names there all just number 1 number 2 number 3 and number 4 so any advice on that would really help me so I can finish this program thanks
numbers = [] for i in range(1,5): num = int(input("Enter number" + str(i)+": ")) while num in numbers: print("The number must be unique, try again") num = int(input("Enter number" + str(i)+": ")) numbers.append(num) print("The numbers were:",end=" ") for num in numbers: print(num,end=" ") print() numbers = [] for i in range(1,5): num = int(input("Enter number" + str(i)+": ")) while num < 1 or num > 10: print("The number must be between 1 and 10, try again") num = int(input("Enter number" + str(i)+": ")) numbers.append(num) print("The numbers were:",end=" ") for num in numbers: print(num,end=" ") print()