compose a program that rolls a “dice” that has user inputted X number of sides and prints the number of the side that is “rolled”. (Please read through below carefully)
In this program, define a function named roll_xsided_die. The roll_xsided_die function should accept one parameter named sides. The function roll_xsided_die should handle any integer that is passed as argument to the parameter sides. When is roll_xsided_die is called or executed, the function should return a random integer from one to and including the value sides, with each value being equally likely.
The program should prompt the user with the string “Input side count: ”
If a 0 is inputted, print “Please enter a value greater than 0”
If anything else is inputted, pass that value to roll_xsided_die and print the return value from roll_xsided_die
Suggestion:
Import the random module
Use random.randint(start, stop) (both numbers are included)
Example Input A:
Input side count: 6
Example Output A:
6
Example Input B:
Input side count: 5
Example Output B:
3
Example Input 0:
Input side count: 0
Example Output 0:
“Please enter a value greater than 0
We are a professional custom writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework.
Yes. We have posted over our previous orders to display our experience. Since we have done this question before, we can also do it for you. To make sure we do it perfectly, please fill our Order Form. Filling the order form correctly will assist our team in referencing, specifications and future communication.
1. Click on the “Place order tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
2. Fill in your paper’s requirements in the "PAPER INFORMATION" section and click “PRICE CALCULATION” at the bottom to calculate your order price.
3. Fill in your paper’s academic level, deadline and the required number of pages from the drop-down menus.
4. Click “FINAL STEP” to enter your registration details and get an account with us for record keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
5. From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.
Need this assignment or any other paper?
Click here and claim 25% off
Discount code SAVE25