Answers for "Dice roll and coin flip"

0

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'
Posted by: Guest on April-21-2022

Python Answers by Framework

Browse Popular Code Answers by Language