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)



Output


Picture showing the output of importing pi attribute from math module



Call Tan Function




from math import pi
print(tan(1))



Output


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





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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250