Advertisement
ohjuny

Petals On The Rose

Jun 4th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #Petals on the Rose (new)
  2.  
  3. from random import randint
  4.  
  5. while True:
  6.    
  7.     dice = []
  8.     ans = 0
  9.    
  10.     for h in range(0, 5):
  11.         a = randint(0, 6)
  12.         dice.append(a)
  13.         print(a)
  14.    
  15.     for die in dice:
  16.         if die % 2 == 1:
  17.             ans += die - 1
  18.    
  19.     guess = int(input("What is your guess? "))
  20.    
  21.     if guess == ans:
  22.         print("Yay! You win!")
  23.         break
  24.     else:
  25.         print("Try again!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement