samedi 29 février 2020

Is the code for this coin flip programme good?Does it need improvements? [closed]

I'm a beginner in python and I dont know if this code is good or if it needs improvements

import random

heads = 0
tails = 0

coin = input("Write heads or tails[heads/tails]")

if coin.upper() == "HEADS":
  heads = random.randint(1, 2)
  print(heads)
if coin.upper() == "TAILS":
  tails = random.randint(1, 2)
  print(tails)



Aucun commentaire:

Enregistrer un commentaire