用户:我是一个大憨批查看:0 回复:0 评论:0 创建时间:2022-03-15T07:55:08
【作品展示】

【作品介绍】
非常准的计算器
【作品源代码】
import easygui as g
import random as r
p=int(r.randint(0,4))
g.msgbox("欢迎使用非常准牌计算器",title="非常准计算器")
a=g.buttonbox("第一个数",choices=["1","2","3","4","5"],title="非常准计算器")
yunsuan=g.buttonbox("运算",choices=["加","减","乘","除"])
b = g.buttonbox("第二个数",choices=["1","2","3","4","5"],title="非常准计算器")
if yunsuan=="加":
c = str(int(a)+int(b)+p)
g.buttonbox(a + "+"+b+"="+c, choices=["准", "非常准"], title="非常准计算器")
elif yunsuan=="减":
c = str(int(a)-int(b)+p)
g.buttonbox(a + "-"+b+"="+c, choices=["准", "非常准"], title="非常准计算器")
elif yunsuan=="乘":
c = str(int(a)*int(b)+p)
g.buttonbox(a + "x"+b+"="+c, choices=["准", "非常准"], title="非常准计算器")
elif yunsuan=="除":
c = str(int(a)/int(b)+p)
g.buttonbox(a +"÷" +b+"="+c, choices=["准", "非常准"], title="非常准计算器")
pass
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn