ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
s = 'The Quick'
print(s.lower().split(), s.split('Q')[0].strip(), s[s.index(' ') + 1:], s.title().swapcase())
  1. A. ['the', 'quick'] The Quick tHE qUICKS
  2. B. ['the', 'quick'] They Quick tHE qUICK
  3. C. ['the', 'quick'] The Quick tHE qUICK
  4. D. ['the', 'quick'] The Quick tHE quic

Correct answer: C. ['the', 'quick'] The Quick tHE qUICK

split('Q') cuts before the capital Q, so strip gives 'The'. title() gives 'The Quick' and swapcase() flips it to 'tHE qUICK'.

More Python Programming questions

Exams that ask this topic