Lesson 21: (Combined with Bronze) Random numbers

posted Mar 29, 2018, 8:00 AM by Attila Lengyel
import random, time

def wait():
  for x in range(0,9):
    print("...")
    time.sleep(1 - x * 0.1)

v = input("Head or Tail?:")
print("You guessed", v, "!")

r = random.randint(0,100)
coin = ""
if r < 50:
  coin = "Tail"
else:
  coin = "Head"
wait()
if v == coin:
  print("It is", coin ,"You won!!!")
else:
  print("It is", coin ,"You lost...")
 
for x in range(0, 100):
  print(random.randint(1,6))

 
 
Comments