Question: Short Python questions. Problem 3A-C. Thanks :) Define functions to perform the following tasks, obeying these requirements: Assume that the math library has been imported
Define functions to perform the following tasks, obeying these requirements: Assume that the math library has been imported for you. Do NOT ask the user for input unless the specification explicitly requires it. Do NOT print anything unless the specification explicitly requires it. Problem 3A Consider this code print ("The area of circle with radius 5 is math.pi 5 2) print("The area of circle with radius 8 is math.pi 8 2) print ("The area of circle with radius 2 is math. pi 2 2) Eliminate the redundancy in this code by defining an area function that takes 1 param- eter: radius of circle and prints out the area of circle This function can be then called three times to produce exactly the same output as above: area(5) area(8) area(2) Problem 3B Define a function named num evens that: Takes 1 parameter: a list of integers Returns the number of even integers in that list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
