ProgrammingHardGATE CS · Product-company placement

What is printed?

What is printed?
print("ß".upper(), "ß".casefold() == "SS".casefold(), "fi".upper(), len("ß".upper()))
  1. A. ß False fi 1
  2. B. SS True FI 2
  3. C. SS False FI 2
  4. D. ẞ True FI 1

Correct answer: B. SS True FI 2

Unicode case mapping can change length: 'ß'.upper() is 'SS' and the ligature 'fi' uppercases to 'FI'. casefold() maps ß to 'ss', so it matches 'SS'.casefold().

More Python Programming questions

Exams that ask this topic