I'm trying to write a code but there's something wrong. I'm not able to print the result of a function. Here is a mini example of what's wrong in my code:
import math
def area(r):
"It will display the area of a circle with radius r"
A = math.pi*r**2
print("The answer is:", str(A))
return A
area(3)
print(str(A)) # This line is not working
# NameError: name 'A' is not defined