ProgrammingVery hardCAT · MBA placement

What is printed?

What is printed?
print('²'.isdigit(), '²'.isdecimal(), '²'.isnumeric(), '٥'.isdecimal())
  1. A. True False True True
  2. B. True True True True
  3. C. False False True True
  4. D. True False False True

Correct answer: A. True False True True

The superscript two is a digit but not a decimal character, so isdigit() is True and isdecimal() is False. isnumeric() is True for it, and the Arabic-Indic five is a decimal character.

More Python Programming questions

Exams that ask this topic