ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print('%s' % None, '%r' % None, '%d' % True)
  1. A. None None True
  2. B. None 'None' 2
  3. C. None None 1
  4. D. None None 0

Correct answer: C. None None 1

%s and %r both show None for the None object here, while %d converts True to the int 1.

More Python Programming questions

Exams that ask this topic