Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import random
  2.  
  3. def rollDice():
  4.     dice1 = random.randint(1,6)
  5.     dice2 = random.randint(1,6)
  6.     dice3 = random.randint(1,6)
  7.     dice4 = random.randint(1,6)
  8.     dice5 = random.randint(1,6)
  9.    
  10.     # For testing 50
  11.     # dice1 = 1
  12.     # dice2 = dice1
  13.     # dice3 = dice1
  14.     # dice4 = dice1
  15.     # dice5 = dice1
  16.    
  17.     if (
  18.         dice1 == dice2 and dice2 == dice3 and
  19.         dice3 == dice4 and dice4 == dice5
  20.         ):
  21.         return 50
  22.     else:
  23.         return 0
  24.  
  25. print ("The result is:",rollDice())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement