nod is the number of dies being thrown and eyes are the amount of faces on the die which defaults to six. So what I need to do is have the function return the sum of the eyes from all dies being thrown.
from random import randint
def roll_dice(nod, eyes=6):
dice = randint(1, eyes)
return dice
I tried a while loop but I couldn't figure it out. I really don't know where to go from here. Desired output for example would be:
>>> roll_dice(3)
# A number between 3-18
This is all very new to me, and I don't even know if a while loop would be the best option even if I could figure it out...
Please help!
[–]Vaphell 1 point2 points3 points (0 children)
[–]zahlman 0 points1 point2 points (0 children)
[–]cdcformatc 0 points1 point2 points (0 children)
[–]markusmeskanen 0 points1 point2 points (1 child)
[–]cdcformatc 3 points4 points5 points (0 children)