How to convert int to float in python?

前端 未结 6 1167
慢半拍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

    The answers provided above are absolutely correct and worth to read but I just wanted to give a straight forward answer to the question.

    The question asked is just a type conversion question and here its conversion from int data type to float data type and for that you can do it by the function :

    float()

    And for more details you can visit this page.

提交回复
热议问题