-
-
Save stephengruppetta/d811e29b7096096d6f97cbe5d38ef281 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def roll_dice(max_value, number_of_dice): | |
return [ | |
random.randint(1, max_value) | |
for _ in range(number_of_dice) | |
] | |
# Roll two six-sided dice | |
print(roll_dice(6, 2)) | |
# Roll four ten-sided dice | |
print(roll_dice(10, 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment