Question: Python programming 3.1 The objective of this problem is to demonstrate that you know how to use a while loop and can compute a running

Python programming 3.1

The objective of this problem is to demonstrate that you know how to use a while loop and can compute a running total. You'll need to import the random module. In a while loop, simulate rolling dice using the randint function. Within each iteration of the loop, roll a pair of dice. Do this by calling randint twice once for the first die and again for the second die. Count each time the loop runs. Compare the two values. When both values are equal, exit the loop. Then display which two values matched and how many times the loop ran before you found a match. Your display should look like this, assuming that each die had a value of three:

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!