Advertisement
akchonya

borisova7

Feb 17th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. def amount_of_letters(word):
  2.     temp_list = []
  3.     for n in range(0, len(word)):
  4.         if word[n] in temp_list:
  5.             pass
  6.         else:
  7.             temp_list += word[n]
  8.    
  9.     temp_str = ''.join(temp_list)
  10.     for i in range(0, len(temp_str)):
  11.         if temp_str[i].isalpha():
  12.             pass
  13.         else:
  14.             temp_list.remove(temp_str[i])
  15.     uniq_len = len(''.join(temp_list))
  16.     return uniq_len
  17.  
  18. word = input('Введіть слово: ')
  19. print('Кількість унікальних букв:', amount_of_letters(word))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement