Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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}')
 
PREVIOUS NEXT
Tagged: #python #coin #flip
ADD COMMENT
Topic
Name
7+1 =