Untitled

mail@pastecode.io avatar
unknown
python
a month ago
321 B
2
Indexable
Never

# Online Python - IDE, Editor, Compiler, Interpreter

import random
coin = random.randint(0,1)
print(coin)

if coin == 0:
    coinface = "heads"
else:
    coinface = "tails"
        
guess = str(input("Guess heads or tails?"))

if guess == coinface:
    print("Correct!")
else:
    print("Sorry, it is " + coinface +".")
Leave a Comment