Question: This program is for Python 3.5 Create a program that will roll dice for a dice game. For this you will have to use sys.

This program is for Python 3.5

This program is for Python 3.5 Create a program that will roll

Create a program that will roll dice for a dice game. For this you will have to use sys. argv to accept a bunch of dice strings formatted as xdy. In this string Y is an integer that tells us how many sides the die has and x tells us how many times to roll the die (i.e. 5D6 means to roll a 6 sided die 5 times). The program should print out the result of each roll as well as the total of each dice string. Your program should be able to accept an arbitrary number of dice strings from the command line. Make sure your program has a function to check each xdy argument for correctness. An example output for rolling a 20-sided die one time and then a 6-sided die 3 times are given below: >>> LUCENT_DEL_dice.py 1D20 5D6 D20 #1: 17 Total D20: 17 D6 #1: 3 D6 #2: 2 D6 #3: 3 D6 #4: 6 D6 #5: 1 Total D6i 12 You will have to have a main () function for both of these programs as well as separate functions in the second program that ensure the dice string is correctly formatted AND another to a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!