QuestionQ137

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the anticipated output of the following code?

Question Image

Explanation

Adding the tuples concatenates them into (1, 2, 3, 4). The list comprehension iterates once over that tuple, and sum(x) evaluates to 10, which print outputs.

Community Discussion

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