Thu Feb 06 2020 19:00:00 GMT+0000 (UTC)
>>> int(3.7) 3 >>> int(-3.4) -3 >>> int(round(3.8)) 4content_copy
Note: the first two methods do not round off the number. They only truncate the float up till the decimal point. Use the 3rd method (line 7), to first round off the number and then convert to integer. This should work in all versions of Python.