0

Umm...

Import opened a entire part of the Module but what means (from import . It opened the half part of modules?? What i dont understand it. Can u explain??

29th Sep 2020, 4:54 PM
Kir-Py
Kir-Py - avatar
1 Answer
0
I'm not sure what you're talking about. Here is the lesson on modules in the Python 3 course: https://www.sololearn.com/learn/Python/2438/ If you're not on mobile or you don't have access to the lessons yet, here is a basic explanation (assuming you're talking about using the from keyword for importing). I'll try to explain this using an example. There is a function called sqrt() in the math module that allows you to get the square root of a number. One way of importing and using it is this: import math math.sqrt(number) If you don't want to have to use the "math." part, you can do this instead: from math import sqrt sqrt(number) If you replace import sqrt with import *, I think you pretty much import everything in that module, so this works too: from math import * sqrt(number) Hope that clears it up.
29th Sep 2020, 5:14 PM
Zerokles
Zerokles - avatar