Question: Consider the following Python file (listing 4.1): from math import pi def new_pizza_calculator (diameter, cost): !! (number, number) -> float Calculates and returns the approximate

 Consider the following Python file (listing 4.1): from math import pi

Consider the following Python file (listing 4.1): from math import pi def new_pizza_calculator (diameter, cost): "!! (number, number) -> float Calculates and returns the approximate cost per slice of a pizza of given diameter and cost. Examples: >>> new_pizza_calculator (12, 15) 1.07 >>> new_pizza_calculator (18, 20) 0.62 . 6 7 8 9 20 11 12 13 14 15 16 17 18 19 20 21 22 23 r = diameter / 2 area - pir 2 number_of_slices - round (area/ 8) cost_per_slice - cost / number_of_slices cost_per_slice = round (cost_per_slice, 2) return cost_per_slice diameter = 20 my_cost = 30 new_pizza_calculator (diameter, my_cost) If the file above is run and __name__ == '_main__ which of the following are examples of Python objects in the global namespace? diameter, my_cost, math diameter, pi, new_pizza_calculator diameter, cost, new_pizza_calculator none of these options diameter, cost, math

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!