Question: Create a function named get_area_circle that accepts one argument r, which is the radius of the circle Function arguments: This function accepts one argument, r.
Create a function named get_area_circle that accepts one argument r, which is the radius of the circle
Function arguments: This function accepts one argument, r. r is the radius of the circle whose area to be calculated
What does it do: Computes the area of a circle with a radius r.
What it returns: It returns the area of the circle with a radius r.
For Example,
get_area_circle(3)
should return
28.27
For Example,
get_area_circle(1)
should return
3.14
2.
Create a function named get_factorial that accepts one argument number, which is the number of which we would compute the factorial
Function arguments: This function accepts one argument, number.
What does it do: Computes the factorial of a given number.
What it returns: It returns the factorial of a given number
For Example,
get_factorial(5)
should return
120
For Example,
get_factorial(6)
should return
720
3.
Create a function named sum_lists that accepts two arguments: list_1 and list_2 and sums the two lists elementwise given that they all contain numbers and of equal size
Function arguments: This function accepts two arguments list_1 and list_2
What does it do: Sums up the elements of two lists
What it returns: It returns a list
For Example,
sum_lists([4, 5, 7], [-1, 5, 120])
should return
[3, 10, 127]
For Example,
sum_lists([4, 5], [-1, 5, 120])
should
throw an error as the lists are of different size
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
