Question: C https//learn.zybooks.com/zybook/UICCS111Fall2018Law/chapter/6/section/18 Rookks My library> CS 111: Program Design I home> yboohs 6.18: Lab9 on Nov 13. Exercise in writing fairly straightforward functions E zyBooks
C https//learn.zybooks.com/zybook/UICCS111Fall2018Law/chapter/6/section/18 Rookks My library> CS 111: Program Design I home> yboohs 6.18: Lab9 on Nov 13. Exercise in writing fairly straightforward functions E zyBooks catalog Help/FAO Noc 6.18 Lab9 on Nov.13: Exercise in writing fairly straightforward functions This week's lab is an exercise in writing fairly straightforward functions. You guys are supposed to submit one py file with these several functions. When you try to test a function you write, just call the function and see if the return value is correct, but when you are submitting you lab, remember to comment these lines. Also, remember the docstrings; points will be deducted for missing docstrings Here are the requirements of these functions 1. Write a function called avg3 which has 3 inputs, returns the average of these 3 input parameters. No need to check or convert input 2 Write a function prod(start,stop) Meturns the product of the integers start through stop inclusive. Eg, if we call prod(3.5): it should 3. Write a function called pi approximate which has one input n, an integer, and use the following formula to calculate a famous types return 60 as 3x4x5. You may assums the inputs are integers approximation of pi if n 0, return 0. Else return the sum of first n terms of the approximation 4/1 4/3+4/5-4/7+4/9.. E.g. if n-2, then the result should be 4/1 -4/3, that is approximately 2.67, You may just return the long decimal Python gives you, such as 2 66666666666667, you don't need to calculate the fractional number or truncate the decimals. You are required to use at least one for loop in your function and you may not use any while loops Type here to search 080
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
