What's The difference b/w 'import math' and 'from math import *' ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's The difference b/w 'import math' and 'from math import *' ?

23rd Apr 2020, 9:19 AM
Shri Krishna
Shri Krishna - avatar
2 Answers
+ 1
import math means you are importing whole library. Unlike from math import random(or something what you wanted instead of random) you are importing specific function from math library
23rd Apr 2020, 10:28 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar