# Every python file itself is known as one module... # python supports 2 types of import statements. 1. Normal import, 2. From import # import demo.py in this file also.. import demo as x import math as y b = 2000 def f2(): print("in f2 of test") print(b) f2() print(x.a) x.f1() print(y.pi) p = y.sqrt(1000) print(p)
# import demo.py in this program as normal import method.. import demo import math b=2000 def f2(): print("in f2 of test") print(b) f2() print(demo.a) demo.f1() print(math.pi) p=math.sqrt(1000) print(p)
from demo import a, f1 from math import pi, sqrt b = 2000 def m1(): print(" in m1 of") print(b) m1() print(a) f1() print(pi) p = sqrt(100) print(p)