QuestionQ165

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the output of the following code?

Question Image

Explanation

In Python, the trailing comma creates a single-element tuple, so x contains one item and len(x) returns 1.

Community Discussion

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