Python dice rolling

You should write a program that rolls two dices 100 times and shows the results.

Each toss should be random like in real life.

Use standard dices with values from 1 to 6.

Call the program dice.py and upload it on BB.

Strategies:

Roll each dice once. For this you will need the random library (import random)

A way of doing it is using random.uniform(a,b)

Note that random functions usually return a float so you must convert it to an integer.

 

Store the result from each dice in an array (so you will need two arrays).

 

Sum the corresponding tosses and display the results. So, if dice one is 3 and dice two is 4, display 7.

 

Additionally, display the most frequent number generated.

 

Each time you call this program, results should be different.

Need a custom answer at your budget?

This assignment has been answered 4 times in private sessions.

© 2024 Codify Tutor. All rights reserved