ProgrammingModerateCodeforces-style · placement coding round

What is printed?

What is printed?
print(int('0012'), int('ff', 16), int('0b11', 0), int('12_34'))
  1. A. 12 255 3 12
  2. B. 0 255 3 1234
  3. C. 12 255 0 1234
  4. D. 12 255 3 1234

Correct answer: D. 12 255 3 1234

int with base 0 reads the 0b prefix, and underscores are allowed between digits from Python 3.6. Leading zeros are ignored in base 10.

More Python Programming questions

Exams that ask this topic