python coin flip

Solutions on MaxInterview for python coin flip by the best coders in the world

showing results for - "python coin flip"
Liah
13 Jul 2019
1# Import the RANDOM library.
2import random as RANDOM # the 'as RANDOM' part could be optionial, 
3# it's just choosing a name for the import.
4
5def flip():
6  flipped = RANDOM.choice('Heads','Tails')
7  print(f'You flipped {flipped}')