i have file name circle.py with code
import math
def circle_area(r):
return math.pi * (r ** 2)
radii = [1, 0, 2 + 5j, -1, True, 'radius']
str = 'area of circle with radius = {radius} is area = {area}'
for r in radii:
a = circle_area(r)
print(str.format(radius=r, area=a))
and another file name cal.py with code:
from circles import circle_area
circle_area(2)
but instead of just running the circle_area function from circle it is running whole file which is resulting an error becuase there i am trying to find area using string instead of int
how can i just use this function and not run whole code there is no problem with indentation i have written and run the code from scratch in two different laptop but still getting the same error