If you use "from moduleName import ....", you get all the classes, functions and variables that you specified after import, or everything if you specify * .: from random import * for I in range (15):
print randrange (3,13,3)
But note that it’s not very good to import everything, it would be better to import only the necessary classes, functions and variables, so if you only need a randrange that you need to use:
from random import randrange for i in range(15): print randrange(3,13,3)
If you use random import, it means that you are importing a module, so you need to specify moduleName. when you want to use it like this:
import random for i in range(15): print random.randrange(3,13,3)
source share