Number of different letters X36667


Statement
 

pdf   zip

html

A code to compute the number of different letters a word has is desired. Write a function num_dif_letters_list(f) that provided a list of words f returns a list of numbers. Each number in the result list has to be the number of different letters of the corresponding word in f. All words in f consists of lowercase letters.

Sample session
>>> num_dif_letters_list(['alea', 'iacta', 'est'])
[3, 4, 3]
>>> num_dif_letters_list(['', 'z', 'zz', 'zzz', 'zzzz'])
[0, 1, 1, 1, 1]
>>> num_dif_letters_list([])
[]
>>> num_dif_letters_list(['atalaya', 'orinoco', 'pasas', 'elixir'])
[4, 5, 3, 5]
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python