how to round in python math code example Example 1: python round to nearest integer Variable = int(round(Variable)) Example 2: rounding numbers in python >>> round(2.5) 2