Importing modules

Now, after creating a module, we will learn how to import that module. In the previous example, we created a sample module. Now we will import the sample module in add.py script:

add.py
import sample
sum = sample.addition(10, 20)
print(sum)

Output:
30
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset