Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Dice roll and coin flip

import random

def dice_roll():
  return random.randint(1, 6)
  
def coin_flip():
  if random.randint(1, 2) == 1:
    return 'heads'
  else:
    return 'tails'
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Dice #roll #coin #flip
ADD COMMENT
Topic
Name
6+1 =