Question: Use Python 3 to complete the following using *args and **kwargs: 2. Create a function sum1() that takes two arguments x and y and returns
Use Python 3 to complete the following using *args and **kwargs:

2. Create a function sum1() that takes two arguments x and y and returns their sum. Demonstrate your working function by running the following commands: print(sum1(2,3)) print(sum1(x=3, y=4)) 3. Create a function sum2() that takes two arguments x and y with default values of 10 and 20, respectively, and returns their sum. Demonstrate your working function by running the following commands: print(sum2) print (sum2(2)) print(sum2(y=5)) 4. Create a list of 100 elements called listi using range(). 5. Create a function sum3 that takes n arguments and computes their sum. Demonstrate your working function by running the following commands: print (sum3) print (sum3 (2,3)) print(sum3("list1))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
