QuestionQ122

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the resulting output of the following code?

Question Image

Explanation

Dictionary keys are iterated in insertion order. The expression str(value)[1] obtains the second character of each key—a, o, and o—and end="" prints them consecutively, producing aoo.

Learn more

Community Discussion

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