Question: Python - Add an integer validation function and replace the two integer input statements with a call to the integer validation function. Review the code

Python - Add an integer validation function and replace the two integer input statements with a call to the integer validation function. Review the code and make sure you understand how it works.

Python - Add an integer validation function and replace the two integer

add comments

import randonm def getDie ) rolls dieNum- int (input ("Enter the number of Dice")) diesides-int (input ("Enter how many sides the Dice have")) rollsstr (random.randint (1, dieSides))',' return dieNum, dieSides, rolls num, sides, rollvaluesgetDie () print ("Using %d die with %d sides returns %s "%(num, sides, rollvalues [:-2]))

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!