Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON: Dice Rolling Write a script that takes input for the number of dice to roll and for the number of sides for the dice.

PYTHON: Dice Rolling

  1. Write a script that takes input for the number of dice to roll and for the number of sides for the dice. Roll that many n-sided dice and store the values an array. Take the number of sides of the dice and the number of dice as typed inputs from the user. Output should be a comma separated list of the die numbers with no spaces like this: 6,4,1,3,1
  2. Write a script that will simulate the roll of an UNFAIR 6-sided die. Instead of each side having an even chance of coming up (1/6 = 16.7%), the middle numbers should be favored. There should be a 20% chance of rolling a 2, 3, 4, or 5, and only a 10% chance of rolling a 1 or a 6. Hint: You will need the round function and some other simple math. This is hard because of the thinking involved, not because of the coding; in fact, you can write it in one (sort of complex) line of code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

2. Describe why we form relationships

Answered: 1 week ago

Question

5. Outline the predictable stages of most relationships

Answered: 1 week ago