Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- #Picking up the coin array
- comment = ["Finding the coin...", "Saving the world from a massive plague...", "Actually flipping a coin...", "Introducing Bias...", "Hacking your computer...", "Entering the matrix...", "Making Python bite...", "Giving all your details to the NSA...", "Thinking of more phrases...", "Stealing your bank account details...", "Planning mission to SePT-A 51..."]
- #side of coin, so no errors
- side = 1
- #assigns variables first
- headcount = 0
- tailcount = 0
- #Coin flip array
- coin = ["Heads", "Tails"]
- #Reset of counts
- def resetheadtail():
- headcount = 0
- tailcount = 0
- side = 1
- #Flip program
- def flipit(random, time, comment, headcount, tailcount, side):
- time.sleep(1)
- print("It begins...")
- print("\n")
- for x in range(0, 10):
- print("Flip number", x + 1)
- side = random.choice(coin) # get the random choice
- print(random.choice(comment))
- time.sleep(1)
- print(side) # print it
- if side == "Heads":
- headcount += 1
- else:
- tailcount += 1
- time.sleep(2)
- print("\n")
- print("You got", headcount, "heads and", tailcount, "tails!")
- print("Type start() to begin flipping coins again")
- resetheadtail()
- #Startup routine
- def startup(time):
- #Coundown
- print("Coins will start falling in...\n5")
- time.sleep(1)
- print("\n4")
- time.sleep(1)
- print("\n3")
- time.sleep(1)
- print("\n2")
- time.sleep(1)
- print("\n1")
- time.sleep(1)
- print("\n")
- flipit(random, time, comment, headcount, tailcount, side)
- #Ease of access
- def begin():
- startup(time)
- begin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement