Write a python program that will take an input n from the user and then take n number of circle’s radius input from the user. After that your program will calculate the area and circumference of the circle and store it in a dictionary where a key will be the circle number and value will be a list containing area first and then circumference of that circle. Finally print the dictionary. Area of circle = pi * r * r Circumference of circle = 2 * pi * r Sample input 1: 3 2 3 4 Sample Output 1: {'Circle 1': [12.566370614359172, 12.566370614359172], 'Circle 2': [28.274333882308138, 18.84955592153876], 'Circle 3': [50.26548245743669, 25.132741228718345]}
Write a python program that will take an input n from the user and then
take n number of circle’s radius input from the user. After that your
program will calculate the area and circumference of the circle and store
it in a dictionary where a key will be the circle number and value will be
a list containing area first and then circumference of that circle. Finally
print the dictionary.
Area of circle = pi * r * r
Circumference of circle = 2 * pi * r
Sample input 1:
3
2
3
4
Sample Output 1:
{'Circle 1': [12.566370614359172, 12.566370614359172], 'Circle 2':
[28.274333882308138, 18.84955592153876], 'Circle 3': [50.26548245743669,
25.132741228718345]}
I have provided python code with full detail explanation below.
Step by step
Solved in 2 steps with 1 images