Python basics | Sololearn: Learn to code for FREE!


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


2 Answers

New Answer


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


Yes I see now, thank you for explaining.