Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import random
- def dice_game():
- rolls = int(input("how many times would you like to roll the dice: "))
- dice_value1 = np.random.randint( 1, 7, rolls)
- print(dice_value1)
- dice_value2 = np.random.randint( 1, 7, rolls)
- print(dice_value2)
- return dice_value1, dice_value2
- result1, result2 = dice_game()
- def dice_game_analysis(x,y):
- total = 0
- for i in range(len(x)):
- for p in range(i):
- if i == p:
- if i == 1:
- total = 0
- if i <= 4:
- total += x
- if i >= 5:
- total += 2*x
- print(total)
- dice_game_analysis(result1, result2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement