python round 2.5 1

python round 2.5

i = round(2.5)

Here is what the above code is Doing:
1. We’re creating a variable called “i” and assigning it the value of the result of the round() function.
2. The round() function takes one argument, which is the number we want to round.
3. The number we’re passing to the round() function is 2.5.
4. The round() function will return the value of 2.5, rounded to the nearest integer.
5. We’re assigning the value of the rounded number to the variable “i”.

Similar Posts