QuestionQ6

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What output is expected from the following code?

Question Image

Explanation

A Python dictionary has a values() method, but it does not have a vals() method. Calling data.vals() raises an AttributeError, so no values are printed.

Community Discussion

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