float to int python round code example Example 1: how to round a float in python round(number, ndigits) Example 2: round to the nearest integer python int(round(x))