Answers for "how to Write a program that simulates a coin toss using random method of py"

-1

python coin flip

# Import the RANDOM library.
import random as RANDOM # the 'as RANDOM' part could be optionial, 
# it's just choosing a name for the import.

def flip():
  flipped = RANDOM.choice('Heads','Tails')
  print(f'You flipped {flipped}')
Posted by: Guest on October-11-2020

Code answers related to "how to Write a program that simulates a coin toss using random method of py"

Python Answers by Framework

Browse Popular Code Answers by Language