callable() — Python Technical Interview Questions & Answers
callable()
callable()
- callable() is built into Python. You do not import it. Freshers only need one honest call and the printed result — not a long definition.
- callable() — output: True then False. len can be called; 21 cannot.
- Wrong type often raises TypeError. Empty values matter for bool/all/any. Don’t mix callable up with a similar name (sorted vs sort, int vs float).
Technical Interview Tip: Call callable() once and say what prints.
Code Examples for callable()
Example
# callable()
print(callable(len))
print(callable(21))
callable() — output: True then False. len can be called; 21 cannot.
How to Explain callable() to an Interviewer
Explain callable() as if you are teaching a junior — definition, then one tiny script.
callable() is built-in — no import. One call + exact output.
What does the example print, and why?
callable() — output: True then False
What mistake do freshers make with callable()?
Wrong type → TypeError.