猫史档案馆


计算器(py作品,源代码如下)

用户:Python球Python球查看:0 回复:0 评论:0 创建时间:2023-02-01T15:39:32


import turtle
import time

__Pen = turtle.Pen()

while (0 == 0):#用while True也行
__Pen.clear()
a = turtle.numinput('对话框', '请输参数1')
b = turtle.numinput('对话框', '请输参数2')
x = turtle.textinput('对话框', '请输算符')
if (x == '+'):
__Pen.write((a + b))
if (x == '-'):
__Pen.write((a - b))
if (x == '*'):
__Pen.write((a * b))
if (x == '/'):
__Pen.write((a / b))#结果显示4s
time.sleep(4)


回复

上一页1 页 / 共 0下一页