0

Why is the answer 4 and not 6 ?

What is the output of this code ? nums= set([1,1,2,3,3,4)] print(len(nums))

20th Oct 2020, 4:45 PM
Curious Ant
Curious Ant - avatar
1 Answer
+ 11
`set` object does not store duplicate values, so in this case the stored values are 1, 2, 3, 4. That's why 4 is the answer. https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2464/
20th Oct 2020, 4:49 PM
Ipang