Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function called roll_dice which takes, in order, a number representing the number of dice and a number representing the number of sides on

image text in transcribed

Write a function called roll_dice which takes, in order, a number representing the number of dice and a number representing the number of sides on the dice. The function should print a dice roll with a value between 1 and the number of sides on the die for each of the number of dice. You should seed the random number generator with the value 10. You should make two successive calls to this function using the values 4, 8 and 5, 10. You may hard code these values into your main function. Write a function called roll_no_pair_dice which takes, in order, a number representing the number of dice and a number representing the number of sides on the dice. You should seed the random number generator with the value 10. This version of rolling the dice will only print rolls where the two die have different numbers. For instance, two rolls of two 6-sided dice could result in: 1 34 6 But not: 1 1 2 3 You must call your is equal function to test whether the two die are the same. You should make one call to this function using the values 5, 10. You may hard code these values into your main function LAB ACTIVITY 7.31.1: Homework 5 - Functions 0/15 | main.py Load default template... 1 import random 2 # Write your functions here in 000 11 def main(): # call your functions here 14 15 maino

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago

Question

f. What stereotypes were reinforced in the commercials?

Answered: 1 week ago