Question: how to add last = 6 optional function. import random def rollem ( first , last ) : Returns the sum of
how to add last optional function. import random
def rollemfirst last:
Returns the sum of two random numbers.
The numbers generated are between first and last inclusive
Example: rollem can return any value between and
Parameter first: The lowest possible number
Precondition: first is an integer
Parameter last: The greatest possible number
Precondition: last is an integer, last first
#generating num and num randomly in range first last
num random.randintfirstlast
num random.randintfirstlast
result num num #storing num num in result
thesum result
return thesum
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
