I'm making a program that flips heads or tails with an opponent. Here's the code:
import random
Choice=input("Do you want to flip a coin?")
while Choice=="yes":
flip=input("Choose heads or tails!")
fliprandom=("heads","tails")
opponentflip=random.choice(fliprandom)
print ("you flipped",flip,"and your opponent flipped",opponentflip,":)")
My problem is that I want the user to be asked if they want to flip again, and exit the loop if the answer is 'no.' Right now, the user can say yes or no at the beginning, but the program keeps going if they say yes and doesn't give them any choice to continue or discontinue afterwards. How do I let the user choose to exit the loop?