Untitled

 avatar
unknown
python
10 months ago
321 B
7
Indexable

# 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 +".")
Editor is loading...
Leave a Comment