Programming Language › Python Set MCQ › Question #3798
Single Choice Not Set

QWhat is the output of the following code
aSet = {1, 'PYnative', ('abc', 'xyz'), True}
print(aSet)

ID: #3798 Python Set MCQ 430 views
Question Info
#3798Q ID
Not SetDifficulty
Python Set MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A { ✔ ✖
  • B { ✔ ✖
  • C TypeError ✔ ✖
  • D None ✔ ✖
Correct Answer

Explanation

{‘PYnative’, 1, (‘abc’, ‘xyz’)}

Set already has 1 as item True evaluates to 1. As you know set doesn’t allow duplicate element

Share This Question

Challenge a friend or share with your study group.