Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- # Create function that simulates a coin flip. Each time the function is called,
- # it should randomly select either heads or tails and print it out.
- coin_side = ["heads", "tails"]
- coin = random.randint(0, 1)
- def random_side():
- if coin == 0:
- print(coin_side[0])
- else:
- print(coin_side[1])
- return
- random_side()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement