distancia = float(input("Digite a distância em metros: "))
km = float(distancia/1000)
centimetros = distancia*100
print("A medida de {}m corresponde a {:.0f}km e {:.0f}cm".format(distancia, km, centimetros))
I was writing this code and the AI from github suggested me the final line, but I don't know why it used the ":.0" before the "f" to use the interpolation in this line, can someone explain me this?
Thanks.
I was just trying to practice a little bit, do some exercises.