ProgrammingVery hardJEE Main · CAT placement

What is printed?

What is printed?
print(int('٣') + 1)
  1. A. ValueError
  2. B. 3
  3. C. TypeError
  4. D. 4

Correct answer: D. 4

Python's int() accepts any Unicode decimal digit, not just ASCII 0 to 9. The Arabic-Indic digit ٣ has the value 3, so the result is 4.

More Python Programming questions

Exams that ask this topic