...

/

Puzzle 18: Explanation

Puzzle 18: Explanation

Let’s learn how the built-in round function works in Python.

We'll cover the following...

Try it yourself

Try executing the code below to verify the result:

Press + to interact
print(round(1.5), round(2.5))

Explanation

Rounding seems easy. The snippet round(1.1) evaluates to 1 ...

Access this course and 1400+ top-rated courses and projects.