ProgrammingVery hardCodeforces-style · placement coding round

What is printed?

What is printed?
s = '\u00b2'
print(s.isdigit(), s.isdecimal(), s.isnumeric())
  1. A. True False True
  2. B. False False True
  3. C. True True True
  4. D. True False False

Correct answer: A. True False True

The superscript two is a digit, so isdigit is True, but it is not a decimal digit, so isdecimal is False. isnumeric is True, and int() rejects the character.

More Python Programming questions

Exams that ask this topic