Dec-20-2020, 12:10 AM
I'm very new to programming and am trying to create a coin flipping program in which you call heads or tails, it simulates a flip, and then tells you whether you were right or wrong. My program is working fine until it comes to giving the player their result ("Win" or "loss") as it always outputs "loss". If anyone could help that would be great.
import random print("Heads[1] or Tails[2]?\n") call = input() flip = random.randint(1, 2) if flip == 1: print("\nIt landed on: Heads") else: print("\nIt landed on: Tails") if flip == call: print("\n[YOU WIN]") else: print("\n[YOU LOSE]")