Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions script_library/index.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"format_version": 1,
"data_version": 38,
"updated": "2026-03-28T16:01:25.719Z",
"data_version": 39,
"updated": "2026-03-29T11:08:55.169Z",
"announcement": null,
"categories": [
{
Expand Down Expand Up @@ -936,6 +936,29 @@
"updated": null,
"status": "active",
"lines": 227
},
{
"id": "script_mnbnp2ee",
"name": "简易数学计算器",
"name_en": "简易数学计算器",
"desc": "小学生做的代码,不喜勿喷,若有bug,及时在电子邮箱里反馈",
"desc_en": "小学生做的代码,不喜勿喷,若有bug,及时在电子邮箱里反馈",
"category": "basic",
"file": "scripts/basic/script_mnbnp2ee.py",
"thumbnail": null,
"version": 1,
"file_type": "py",
"author": "程序员小y",
"author_en": "程序员小y",
"tags": [
"community"
],
"requires": [],
"min_app_version": "1.5.0",
"added": "2026-03-29",
"updated": null,
"status": "active",
"lines": 55
}
]
}
54 changes: 54 additions & 0 deletions script_library/scripts/basic/script_mnbnp2ee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
def Menu(): #定义界面
print(('-' * 20))
print('简易数学计算器系统1.0')
print('1.加法运算 2.减法运算 3.乘法运算')
print('4.除法运算 0.退出系统')
print(('-' * 20))

def jia(): #定义加法函数
a = float(input('请输入加数1:'))
b = float(input('请输入加数2:'))
c = a + b
print('和为:',c)

def jian(): #定义减法函数
d = float(input('请输入被减数:'))
e = float(input('请输入减数:'))
f = d - e
print('差为:',f)

def cheng(): #定义乘法函数
g = float(input('请输入乘数1:'))
h = float(input('请输入乘数2:'))
i = g * h
print('积为:',i)

def chu(): #定义除法函数
j = float(input('请输入被除数:'))
k = float(input('请输入除数:'))
l = j / k
print('商为:',l)

def main(): #定义主控制台
while True:
Menu()
key = input('请输入对应功能的数字:')
if key == '1':
jia()
elif key == '2' :
jian()
elif key == '3' :
cheng()
elif key == '4' :
chu()
elif key == '0' :
q = input('是否退出系统?(y or n):')
if q == 'y':
print('已退出系统')
break
else :
print('没有对应此数字的功能!')

main() #调用主函数


Loading