python - Are these statements equivalent?: import package vs from package import * -
this question has answer here:
- 'import module' or 'from module import' 13 answers
are these statements equivalent?:
import math , from math import *
import math means have put math (name of module) before use it, e.g. print(math.pi).
with using from math import *, python loading functions , variables math (or specified in __all__ exact) local namespace , can use them without module name prefix: print(pi).
hope helps!
Comments
Post a Comment