Challenge 2
First Run the code below, then try and recreate the hidden code without looking!
challenge2.py
import random
coin = random.randint(1, 2)
guess = input("Guess either HEADS or TAILS: ")
if coin == 1:
print("Coin flip is HEADS")
else:
print("Coin flip is TAILS")
if (guess == "HEADS" and coin == 1) or (guess == "TAILS" and coin == 2):
print("You guessed right!")
else:
print("You guessed wrong :(")