I am making a class similar code to this but I don't know how I will make it into a input function.
How would I ask the user to input a radius of a circle?
class Circle:
def __init__(self, r):
self.radius = r
def area(self):
return 3.14 * (self.radius ** 2)
def perimeter(self):
return 2*3.14*self.radius
obj = Circle(3)
print("Area of circle:",obj.area())
print("Perimeter of circle:",obj.perimeter())