Hello there, Please make Roulette Wheel Colors program in PYTHON that works on J
ID: 3607331 • Letter: H
Question
Hello there,Please make Roulette Wheel Colors program in PYTHON that works on JES.
On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the pockets are as follows: - Pocket 0 is green. - For pockets 1 through 10, the odd-numbered pockets are red and the even-numbered pockets are black. - For pockets 11 through 18, the odd-numbered pockets are black and the even-numbered pockets are red. - For pockets 19 through 28, the odd-numbered pockets are red and the even-numbered pockets are black. - For pockets 29 through 36, the odd-numbered pockets are black and the even-numbered pockets are red. Write a program that asks the user to enter a pocket number and displays whether the pocket is green, red, or black – in a picture, as shown in the figures below. The program should display an error message if the user enters a number that is outside the range of 0 through 36 – also within a picture.
4:59 PM outlook.office.com AT&T; 50% Example 1: Example 2: Pocket3 Example 3: Example 4:
Explanation / Answer
userPocketNumber = int (input ("Please enter the Pocket Number of your choice"))
print()
if userPocketNumber < 0 or userPocketNumber >36:
print("Enter a number from 0 to 36")
else:
if userPocketNumber ==0:
print("The pocket is green")
elif userPocketNumber <11:
if userPocketNumber % 2 !=0:
print ("The pocket is red")
elif userPocketNumber % 2 == 0:
print ("The pocket is black")
elif userPocketNumber < 19:
if userPocketNumber % 2 !=0:
print ("The pocket is black")
elif userPocketNumber % 2 == 0:
print ("The pocket is red")
elif userPocketNumber < 29:
if userPocketNumber % 2 !=0:
print ("The pocket is red")
elif userPocketNumber % 2 == 0:
print ("The pocket is black")
else:
if userPocketNumber % 2 !=0:
print ("The pocket is black")
elif userPocketNumber % 2 == 0:
print ("The pocket is red")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.