repl.it
@dcbriccetti/

Call it!

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from random import randint
from time import sleep

def introduce():
  print('Welcome to the game')

def play():
  print('Flipping...')
  choice = input('Call it => ')
  sleep(randint(0, 2))
  result = randint(1, 2)
  if choice == 'heads' and result == 1 or  choice == 'tails' and result == 2:
    print('Right!')
  else:
    print('Wrong')

introduce()
play()
Fetching token
?