I was just wondering if there is a difference between "import math" or "from math import *", is there?
will import the
math module. Any functions that you use would have to be used as
from math import *
will import all functions from
math. Any functions that you use can be used as
math as your refrigerator.
If you import the refrigerator (
import math), you will need to open the refrigerator door to take out the food and bottles, like
But if you import everything inside the refrigerator (
from math import *), then that means you can freely use the food and bottles as they have already been taken from the refrigerator and outside it (so, no need for
refrigerator.food, just use
Thanks! I love the analogy.