python - 有什么办法可以正常退货吗?
问题描述
Spyder 和其他 IDE 说它完全没问题,尽管它没有运行。
def tiempo_transferencia(tamano: float, ancho_banda: int)-> str:
tamano = 80
ancho_banda = 50
tamano_en_MB = round(tamano*1024,2)
ancho_banda_real= ancho_banda*0,125
tiempo = tamano_en_MB / ancho_banda_real
x = tiempo // 3600
residuo1 = tiempo%3600
Y = residuo1// 60
residuo2 = residuo1%60
Z = residuo2 // 1
return "el archivo tardará" + str(x) + "horas" +str(Y)+ "minutos y" +str(Z) + "segundos en transferirse"
解决方案
也许在下面一行:
ancho_banda_real= ancho_banda*0,125
代码 ancho_banda*0,125 被视为一个元组,因此如果要将 ancho_banda 乘以十进制 0.125,请尝试将 0,125 替换为 0.125。
推荐阅读
- google-sheets - 使用查询公式搜索,其中单元格不是空的
- lua - Roblox Lua 中的数据存储
- python - 无法使用熊猫一次复制多个excel列
- c++ - var /= "SomeString" 记录在哪里?
- ruby-on-rails - Rails i18n - 如何在 fields_for 中为 has_one 继承模型翻译模型
- ios - 使用导航控制器传递数据时 viewDidLoad() 加载两次 - SWIFT
- python - 阻止 StanfordCoreNLP 连接到 StanfordCoreNLP 服务器
- ssh - 是否可以将我的本地电脑放在 gcloud 项目域中?
- python - 如何将 TkInter 中的按钮分配给我的脚本?
- android - 在 PageKeyedDataSource 中调用挂起函数的正确方法