MCQ Practice Single Best Answer Topic: Create Objects in Python

Q The output of the expression {i:j for i in "abcd" for j in "kiwi"} is _______.

Question ID
#20274
Subchapter
Create Objects in Python
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A {'a': 'k', 'd': 'i', 'c': 'w', 'b': 'i'}
  • B {'a': 'kiwi', 'd': 'kiwi', 'c': 'kiwi', 'b': 'kiwi'}
  • C Reuslts in error
  • D {'a': 'i', 'd': 'i', 'c': 'i', 'b': 'i'}
Correct Answer: D

Explanation

{‘a’: ‘i’, ‘d’: ‘i’, ‘c’: ‘i’, ‘b’: ‘i’}

Share This Question

Share this MCQ with your friends or study group.