Advertisement
k1alo

Anag

Nov 10th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. word1 = "Нос"
  2. word2 = "Сон"
  3. word1 = word1.lower()
  4. word2 = word2.lower()
  5. count = 0
  6. for i in range(0, len(word1)):
  7.     if word1.count(word1[i]) == word2.count(word1[i]):
  8.         count += 1
  9. if count == len(word1):
  10.     print("Анаграмма")
  11. else:
  12.     print("Не анаграмма")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement