首页 > 解决方案 > 有什么办法可以正常退货吗?

问题描述

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"

标签: python

解决方案


也许在下面一行:

ancho_banda_real= ancho_banda*0,125

代码 ancho_banda*0,125 被视为一个元组,因此如果要将 ancho_banda 乘以十进制 0.125,请尝试将 0,125 替换为 0.125。


推荐阅读