QuestionQ96

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the expected result printed by the following code?

Question Image

Explanation

In Python, comma-separated values form a tuple even without parentheses. Both variables therefore contain the identical tuple ('a', 'b'), and equality comparison evaluates to True.

Community Discussion

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