0

A function which receives a string and returns a value of ourselves different symbols, without register.

f=lambda s='abcA'.lower(): len(set(s)) #It returned 4, but it is necessary to 3.

27th Dec 2019, 12:05 PM
Andrey Shintar
Andrey Shintar - avatar
2 Antworten
+ 1
Solved. Answer is: f=lambda s='abcA'.lower(): len(set(map(str.casefold, s)))
27th Dec 2019, 12:48 PM
Andrey Shintar
Andrey Shintar - avatar
0
Maybe it can be made in other way?
27th Dec 2019, 12:26 PM
Andrey Shintar
Andrey Shintar - avatar