Python basics | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 ?? :/

21st Mar 2018, 4:33 PM
daniel
daniel - avatar
2 Réponses
+ 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
21st Mar 2018, 4:41 PM
Toni Isotalo
Toni Isotalo - avatar
0
Yes I see now, thank you for explaining.
21st Mar 2018, 4:43 PM
daniel
daniel - avatar