Report Bug

Qus

What will be the output of the following Python code?

nums = set([1,1,2,3,3,3,4,4])

print(len(nums))

Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. 7
B. Error, invalid syntax for formation of set
C. 4
D. 8


Solution
C. 4



Explanation
A set doesn’t have duplicate items.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad