repl.it
@nickbeattie/

Video Game Simulation

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import random
import time
color = ['red', 'green', 'blue', 'orange']
redcount = 0
greencount = 0
bluecount = 0
orangecount = 0
for i in range(int(input())):
  chosencolor = random.choice(color)
  if chosencolor == 'red':
    redcount = redcount+1
  elif chosencolor == 'green':
    greencount = greencount+1
  elif chosencolor == 'blue':
    bluecount = bluecount+1
  elif chosencolor == 'orange':
    orangecount = orangecount+1

print()
print()
print("Red =", redcount)
print("Green =", greencount)
print("Blue =", bluecount)
print("Orange =", orangecount)
print()
print("Total =", redcount+greencount+bluecount+orangecount)
print()
Fetching token
?