



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




import example example.add(4,5.5)
Import math Print(โ The value of pi is :โ,math.pi)
Import math as m Print(โ The value of pi is : :โ,m.pi)
From math import pi Print(โThe value of pi is:โ,pi) #importing multiple attributes from math import pi, e Print(โ The value of pi is:โ, pi) Print(โ the value of e is:โ,e)
module using * symbol From math import * Print(โ The value of pi is:โ,pi)
defined inside a module. dir(example) #All other names other than โadd โ that begin with an underscore are default Python attributes associated #with the module (we did not define them ourself) #name attribute contains the name of the module. Import example example.name #All the names defined in our current namespace can be found out using the dir() function without any #arguments. a = 1 b = "hello" import math dir()