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