round() — Python Technical Interview Questions & Answers

round()

round()

  • round() is built into Python. You do not import it. Freshers only need one honest call and the printed result — not a long definition.
  • round() — output: 4 then 3.14.
  • Wrong type often raises TypeError. Empty values matter for bool/all/any. Don’t mix round up with a similar name (sorted vs sort, int vs float).

Technical Interview Tip: Call round() once and say what prints.

Code Examples for round()

Example

# round()
print(round(3.6))
print(round(3.14159, 2))

round() — output: 4 then 3.14.

How to Explain round() to an Interviewer

Explain round() as if you are teaching a junior — definition, then one tiny script.

round() is built-in — no import. One call + exact output.

What does the example print, and why?

round() — output: 4 then 3

What mistake do freshers make with round()?

Wrong type → TypeError.