Situatie
Funcția set() creează un set în Python.
Solutie
Pasi de urmat
print(set())
print(set(‘Python’))
print(set((‘a’, ‘e’, ‘i’, ‘o’, ‘u’)))
print(set([‘a’, ‘e’, ‘i’, ‘o’, ‘u’]))
print(set(range(5)))
Output:
set()
{‘P’, ‘o’, ‘t’, ‘n’, ‘y’, ‘h’}
{‘a’, ‘o’, ‘e’, ‘u’, ‘i’}
{‘a’, ‘o’, ‘e’, ‘u’, ‘i’}
{0, 1, 2, 3, 4}
Leave A Comment?