Python basics | Sololearn: Learn to code for FREE!

0

Python basics

Hi there, I played this challenge and got this question: s = set('solo') s.add('learn') print(s) And the output is: {'o', 'learn', 's', 'l'} Can anyone explain this to me, please ?? :/

3/21/2018 4:33:37 PM

daniel

2 Answers

New Answer

+3

It makes a set from the word solo. Because set items must be unique any duplicated letter will be deleted so only s, o and l letters will be added

0

Yes I see now, thank you for explaining.