How to convert int to float in python?

前端 未结 6 1183
慢半拍i
慢半拍i 2020-12-29 21:39

Does anyone know how to convert int to float.

For some reason, it keeps on printing 0. I want it to print a specific decimal.



        
6条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 22:37

    You can just multiply 1.0

    >>> 1.0*144/314
    0.4585987261146497
    

提交回复
热议问题