User Manual

17-30
Sample 2: Importing a Module
Purpose
import imports a module and makes it possible to run the
functions defined within it. Use the syntax below to execute
function within the module.
<module name>.<function name>
Description
import math
Imports the math module and makes it possible to run the function defined
by it.
P=math.pi
Defines variable P as
pi, which is defined in the math module.
print(P) Outputs the value stored in variable P.
Execution Result
Sample 3: Defining a User-defined Function
Purpose
def defines a user-defined function.
The script below recalls and uses the py script created under
“Sample 4: Importing a py File”.