13 lines
240 B
Python
13 lines
240 B
Python
import random
|
|
|
|
def roll_dice(number: int, sides: int) -> int:
|
|
"""
|
|
Rolls XdY, where X is `number` and Y is `sides`.
|
|
|
|
Returns the total value.
|
|
"""
|
|
total: int = 0
|
|
for i in range(number):
|
|
total += random.randint(1, sides)
|
|
return total
|