Answers for "how to make a heads or tails game in python"

0

heads or tails python

from random import random

def heads_or_tails():
    guess = input('Pick heads or tails and then press eneter to play: ')
    if random() > 0.5:
        return 'tails'
    else:
        return 'heads'

print(heads_or_tails() + ' wins' + '!')
Posted by: Guest on October-07-2020

Code answers related to "how to make a heads or tails game in python"

Python Answers by Framework

Browse Popular Code Answers by Language