小编Rob*_*Rob的帖子

如何在Python中删除整数中的.0

我想删除.0计算这些时间的时间。

current_time = datetime.timedelta(hours = 22, minutes = 30)
program_end = datetime.timedelta(hours = 23, minutes = 40)
program_duration = program_end - current_time
program_widths = int(program_duration.seconds / 60)
program_widths = program_widths * 11.4
Run Code Online (Sandbox Code Playgroud)

输出:

794.0
Run Code Online (Sandbox Code Playgroud)

结果

>>>> 794
Run Code Online (Sandbox Code Playgroud)

你能帮我如何删除.0我使用的整数吗?

python python-2.7

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1

python-2.7 ×1