import math, random
try:
class Circle:
def __init__(self, radius):
if radius == 0:
self.radius = random.uniform(1.1,2.5)
else:
self.radius = radius
def clc(self):
return math.pi * 2 * self.radius
def dia(self):
return self.radius * 2
def area(self):
return math.pi * (self.radius ** 2)
def dia2(self):
return self.radius * 4
circles = []
for i in list(range(0,2)):
s = int(input("enter te radius of the circle : "))
c = Circle(s)
circles.append(c)
except (ValueError) as e:
print('There was an error, try again ?')
print('You keyed a char insted of a number:',e)
else:
print("radius:", c.radius,
"cirm:", c.clc(),'Diameter:',
c.dia(), 'area:', c.area(),
'dia2:', c.dia2())