QuestionQ148

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What output is expected from the following code?

Question Image

Explanation

Python’s max() compares strings lexicographically. Since 'efg' starts with e, which sorts after the initial letters of the other strings, it is the maximum value.

Community Discussion

No comments yet. Be the first to start the discussion!