官术网_书友最值得收藏!

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
主站蜘蛛池模板: 台江县| 彭州市| 河北省| 鄂尔多斯市| 那曲县| 三都| 江津市| 新津县| 兰溪市| 青阳县| 车险| 香港| 宾川县| 麻阳| 宁陕县| 丁青县| 南和县| 江安县| 泾川县| 泗水县| 外汇| 凌云县| 赤峰市| 淮滨县| 卢龙县| 开封县| 靖远县| 阿鲁科尔沁旗| 新龙县| 大同县| 崇仁县| 陇川县| 陇南市| 崇信县| 广宁县| 宁河县| 南部县| 五峰| 龙陵县| 莫力| 专栏|