# test2.py
# coding=utf-8
def hello(b):
c = int(b)
if b - c >= 0.5:
c = c + 1
else:
pass;
return c
'''
while 1:
b = raw_input("Enter you num:")
b = float(b)
hello(b)
'''
# coding=utf-8
import easygui
import test2
choice = easygui.buttonbox("欢迎使用" ,"四舍五入计算器" ,choices=("Enter" , "Cancel"))
if choice == "Enter" :
num = easygui.enterbox("Enter you num :" ,"game" , default=0.0000)
result = test2.hello(float(num))
easygui.msgbox("the result is : %d" % result , "四舍五入计算器")
四舍五入计算器,第一个python—gui程序
最新推荐文章于 2024-06-28 15:41:21 发布
这是一个简单的四舍五入计算器程序,用户输入一个数值后,程序将返回该数值四舍五入后的整数结果。程序使用Python编写,并通过图形用户界面引导用户进行操作。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Python3.8
Conda
Python
Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本
1万+

被折叠的 条评论
为什么被折叠?



