Guest User

Untitled

a guest
Mar 20th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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. if i == y:
  18. if i == 1:
  19. total = 0
  20. if i <= 4:
  21. total += x
  22. if i >= 5:
  23. total += 2*x
  24. print(total)
  25. dice_game_analysis(result1, result2)
Add Comment
Please, Sign In to add comment