Skip to content

Instantly share code, notes, and snippets.

@Irene-123
Created October 1, 2020 14:09
Show Gist options
  • Save Irene-123/cb1be7026fbd15edeac63a46d76e92a8 to your computer and use it in GitHub Desktop.
Save Irene-123/cb1be7026fbd15edeac63a46d76e92a8 to your computer and use it in GitHub Desktop.
Guess the coin Project-Automate the boring stuff
import random
guess=''
while guess not in ('head','tail'):
print('Guess the coin Toss ! heads or tails ?!')
guess=input()
toss=random.randint(0,1)
if toss:
tt='head'
else:
tt='tail'
if tt==guess:
print("Yeah! You guessed it right ! ")
else:
print('Nope! Guess again!')
guess=input()
if tt==guess:
print("Yes ! You got it !")
else:
print("You're too bad at it , huh?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment