I have this problem in my python code which is a coinflip game, the problem is that when It asks, "Heads or Tails?" and I just say 1 or Heads(same for 2 and Tails) without quotation marks and with quotation marks, it does not give me an answer that I am looking for.
I've Tried using quotation marks in my answer which didn't seem to work either.
import randommoney = 100#Write your game of chance functions here
def coin_flip(choice, bet):choice = input("Heads or Tails?")coinnum = random.randint(1, 2)if coinnum == 1:return 1elif coinnum == 2:return 2win = bet*2if choice == "Heads" or "1":return 1elif choice == "Tails" or "2":return 2if choice == coinnum:print("Well done! You have won " + str(win) + " Dollars!")elif choice != coinnum:print("Sorry, you lost " + str(bet) + " Dollars!")coin_flip("Heads", 100)
The expected output was either "Well done! You have won 200 Dollars!" or "Sorry, you lost 100 Dollars!"