I am a newbie to python. Below is my module
mymath.py
pi = 3.142
def circle(radius):
return pi * radius * radius
In terminal, I run it following way:
>>import mymath
>>mymath.pi
>>3.142
When I change pi to a local variable and reload(mymath) and do import mymath, still I get value of mymath.pi as 3.142. However the result of mymath.circle(radius) does reflect the change in result.
def circle(radius):
pi = 3
return pi * radius * radius
>>import imp
>>imp.reload(mymath)
>>import mymath
>>mymath.pi
>>3.142
>>circle(3)
>>27
Can anyone tell me what might be the issue?