当前位置:网站首页>Put functions in modules
Put functions in modules
2022-07-05 13:01:00 【South Lake Fishing Song】
# ------------- compute.py ---------------------------
def add(x,y):
return x + y
def sub(x,y):
return x - y
def mul(x,y):
return x * y
def div(x,y):
return x / y
# ------------- main.py ---------------------------
import compute as cp
print(cp.add(3,5))
print(cp.sub(3,5))
print(cp.mul(3,5))
print(cp.div(3,5))
from compute import add,sub,mul,div
print(add(3,5))
print(sub(3,5))
print(mul(3,5))
print(div(3,5))
from compute import * # Not recommended
print(add(3,5))
print(sub(3,5))
print(mul(3,5))
print(div(3,5))
边栏推荐
- Notes for preparation of information system project manager --- information knowledge
- 10 minute fitness method reading notes (3/5)
- Taobao order amount check error, avoid capital loss API
- 函数的默认参数&函数参数的多种方法
- A possible investment strategy and a possible fuzzy fast stock valuation method
- NLP engineer learning summary and index
- A small talk caused by the increase of sweeping
- 2021.12.16-2021.12.20 empty four hand transaction records
- Free testing of Taobao tmall API order and flag insertion remark interface
- Simply take stock reading notes (1/8)
猜你喜欢

RHCSA5

10 minute fitness method reading notes (3/5)

潘多拉 IOT 开发板学习(HAL 库)—— 实验7 窗口看门狗实验(学习笔记)

Concurrent performance test of SAP Spartacus with JMeter

关于 SAP UI5 floating footer 显示与否的单步调试以及使用 SAP UI5 的收益

MySQL 巨坑:update 更新慎用影响行数做判断!!!

Introduction aux contrôles de la page dynamique SAP ui5

Actual combat simulation │ JWT login authentication

SAP UI5 DynamicPage 控件介绍

Transactions from January 14 to 19, 2022
随机推荐
About the single step debugging of whether SAP ui5 floating footer is displayed or not and the benefits of using SAP ui5
无密码身份验证如何保障用户隐私安全?
SAP UI5 视图里的 OverflowToolbar 控件
你的下一台电脑何必是电脑,探索不一样的远程操作
Super efficient! The secret of swagger Yapi
Introduction to sap ui5 flexiblecolumnlayout control
Kotlin function
Laravel document reading notes -mews/captcha use (verification code function)
太方便了,钉钉上就可完成代码发布审批啦!
NFT: how to make money with unique assets?
《2022年中國銀行業RPA供應商實力矩陣分析》研究報告正式啟動
How can non-technical departments participate in Devops?
Pinduoduo flag insertion remarks API
A possible investment strategy and a possible fuzzy fast stock valuation method
Transactions from December 29, 2021 to January 4, 2022
Oppo Xiaobu launched Obert, a large pre training model, and promoted to the top of kgclue
stm32和电机开发(从架构图到文档编写)
MySQL 巨坑:update 更新慎用影响行数做判断!!!
Free testing of Taobao tmall API order and flag insertion remark interface
Yyds dry inventory JS intercept file suffix

