Articles → Python → Import Selected Attributes Of A Module In Python

Import Selected Attributes Of A Module In Python






Example




from math import pi
print(pi)




Picture showing the output of importing pi attribute from math module

Click to Enlarge



from math import pi
print(tan(1))




Picture showing the error message when attribute is used without importing the module

Click to Enlarge




Posted By  -  Karan Gupta
 
Posted On  -  Friday, April 19, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250