Question: Write a Python program that calculates the area and circumference of a circle. However, you want to ensure that the value of Pi used in

Write a Python program that calculates the area and circumference of a circle. However, you
want to ensure that the value of Pi used in the calculations remains consistent throughout the
program. Use a global constant for the value of Pi (Assign it to 3.14), and then write the program
that uses a global constant for Pi to perform these calculations.
Steps:
- Create a python file circle.py.
- Initialize a global variable pi to 3.14
- Write two functions to calculate area and circumference of the circle respectively.
- Get the radius as input from the user.
- Calculate the area and circumference by calling the above defined functions and print them.

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 Programming Questions!