python int( ) function

前端 未结 5 1767
逝去的感伤
逝去的感伤 2021-02-15 13:06

The code below shows error if a decimal (eg. 49.9) is sent to next variable. Can you please tell me why? Why does int() converts it into an in

5条回答
  •  别那么骄傲
    2021-02-15 13:47

    Use float() in place of int() so that your program can handle decimal points. Also, don't use next as it's a built-in Python function, next().

    Also you code as posted is missing import sys and the definition for dead

提交回复
热议问题