Question: Given the below code snippet of a function definition, answer the following questions, def Function _ demo ( num 1 = 1 , num 2

Given the below code snippet of a function definition, answer the following questions,
def Function_demo (num1=1, num2=2):
num1=num1* num2
num2+= num2
print(num1, num2)
a) Demonstrate the following with appropriate reasoning:
i. Call the given function without any parameters.
ii. Call the given function by passing values 2 and 1 as parameters.
b) Modify the above given Python function such that the calculations
are performed on the parameters only if the values of num1 are greater
than 0 and num2 are less than 10. Provide proper error messages for each
invalid input.

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!