Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
roulette game
#2
Maybe this helps:

#!/usr/bin/python3
import random
red   = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35]
black = [2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36]

while True:
    if input("press 'q' to stop the game or return to continue: ") == 'q':
        break
    number = random.randrange(0, 37)
    print('\nNumber is: ', number)

    if 1 <= number <= 17:
        print('Number is small')
    if number in red:
        print('Number is red')
   #if ....
   #if ...
Reply


Messages In This Thread
roulette game - by atux_null - Oct-28-2017, 12:03 AM
RE: roulette game - by heiner55 - Oct-28-2017, 06:26 AM
RE: roulette game - by atux_null - Oct-28-2017, 05:59 PM
RE: roulette game - by james - Oct-28-2017, 06:21 PM
RE: roulette game - by heiner55 - Oct-29-2017, 05:49 AM
RE: roulette game - by atux_null - Oct-29-2017, 08:59 AM
RE: roulette game - by heiner55 - Oct-31-2017, 08:45 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020