We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47b230d commit af6c0b6Copy full SHA for af6c0b6
bin/dice_simulator.py
@@ -1,14 +1,14 @@
1
import random
2
3
-def roll_dice():
+def roll_dice(range):
4
while True:
5
- dice_side = random.randrange(1, 7)
6
- print("No on the top of dice rolled is ",dice_side)
7
- yes_or_no=input("Do you want to continue y/n ")
+ dice_side = random.randrange(1, range)
+ print("You rolled: " + str(dice_side))
+ yes_or_no=input("Do you want to continue? y/n ")
8
if yes_or_no == 'n':
9
- print("Over !")
+ print("Over!")
10
break
11
12
13
if __name__ == '__main__':
14
- roll_dice()
+ roll_dice(7)
0 commit comments