repl.it
@nickbeattie/

Helicopter Landing Pad

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
import random
landing = ["1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3"]
landingcount1 = 0
landingcount2 = 0
landingcount3 = 0
land = int(input("How many times would you like to land? "))
for i in range(land):
  landingchoice = random.choice(landing)
  if landingchoice == "1":
    landingcount1 = landingcount1 + 1
  elif landingchoice == "2":
    landingcount2 = landingcount2 + 1
  elif landingchoice == "3":
    landingcount3 = landingcount3 + 1
print("You landed on a circle landing pad",landingcount1,"times. (",landingcount1 / land * 100,"% )")
print("You landed on a trapezoid landing pad",landingcount2,"times. (",landingcount2 / land * 100,"% )")
print("You landed on a square landing pad",landingcount3,"times. (",landingcount3 / land * 100,"% )")
Fetching token
?