1. Engineering
  2. Computer Science
  3. python add an integer validation function and replace the...

Question: python add an integer validation function and replace the...

Question details

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.

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]))

add comments

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution