QuestionQ112

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

Consider this code.

Question Image

Which statements print True to the monitor?

Choose two
Explanation

The == operator compares list contents, so two separate lists containing the same elements compare as True. The is operator compares object identity; assigning extra_languages = more_languages makes both variables reference the same list object.

Community Discussion

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