0% found this document useful (0 votes)
5 views1 page

Coin Flip Simulator in Python

Uploaded by

kanu11047
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Coin Flip Simulator in Python

Uploaded by

kanu11047
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

import random

def flip_coin():

result = [Link](["Heads", "Tails"])

print(f"\n It's {result}!")

def main():

print("=== Coin Flip Simulator ===")

while True:

user_input = input("\nPress Enter to flip the coin or type 'q' to quit: ").lower()

if user_input == 'q':

print("Thanks for playing! Goodbye.")

break

else:

flip_coin()

if __name__ == "__main__":

main()

You might also like