Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import numpy as np
  2. import random
  3.  
  4. def dice_game():
  5.  
  6. rolls = int(input("how many times would you like to roll the dice: "))
  7. dice_value1 = np.random.randint( 1, 7, rolls)
  8. print(dice_value1)
  9. dice_value2 = np.random.randint( 1, 7, rolls)
  10. print(dice_value2)
  11. return dice_value1, dice_value2
  12. result1, result2 = dice_game()
  13.  
  14. def dice_game_analysis(x,y):
  15. total = 0
  16. for i in range(len(x)):
  17. for p in range(i):
  18. if i == p:
  19. if i == 1:
  20. total = 0
  21. if i <= 4:
  22. total += x
  23. if i >= 5:
  24. total += 2*x
  25.  
  26.  
  27. print(total)
  28. dice_game_analysis(result1, result2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement