ProgrammingHardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(any([]) or all([]) and 'x')
  1. A. False
  2. B. None
  3. C. x
  4. D. True

Correct answer: C. x

'and' binds tighter than 'or'. any([]) is False, so the value comes from all([]) and 'x'. all([]) is True, so the result is 'x'.

More Python Programming questions

Exams that ask this topic