After re importing module why variable in original module not showing their initial value

Viewed 25
# code of foo.py

var = 7
#code of foo1.py

import foo

print(foo.var) # it prints 7 

foo.var = 9  

print(foo.var) # it prints 9


#from "foo" reload(var)
import foo #reimporting module

print(foo.var) # still it prints 9 instead of 7 why?
2 Answers
Related