Hi! My code isn't working properly and I'm stuck with this problem. Any help is very appreciated. Thanks a lot!
Description In this problem, you will create a Circle class that stores the radius of the object. You will provide two functions to calculate the area and the perimeter Input This problem do not expect any input Output The output is expected as follows: The circle with radius 1.00 has area 3.14 and perimeter 6.28 The circle with radius 10.00 has area 314.16 and perimeter 62.83 The circle with radius 100.00 has area 31415.93 and perimeter 628.32 Main Program (write the Circle class. The rest of the main program will be provided. In the online judge, the main problem will be automatically executed. You only need the Circle class.) Circle class: In [1]: 1 main program: In [2] : 1 a = Circle() 2 b = Circle(10) 3 C = Circle(100) 4 5 15 = [a,b,c] 6 7 8 for i in 15: 9 print(F'The circle with radius {i.radius:3.2f} has area (i.area():4.2f) and perimeter (i.perimeter():4.2f}') The circle with radius 1.00 has area 3.14 and perimeter 6.28 The circle with radius 10.00 has area 314.16 and perimeter 62.83 The circle with radius 109.00 has area 31415.93 and perimeter 628.32
Hi! My code isn't working properly and I'm stuck with this problem. Any help is very appreciated. Thanks a lot!
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am