Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def main():
- a = input("Prv string: ")
- b = input("Vtor string: ")
- a_mapa = dict()
- b_mapa = dict()
- for c in a:
- if c not in a_mapa.keys():
- a_mapa.update({c: 1})
- else:
- a_mapa.update({c: a_mapa.get(c) + 1})
- for c in b:
- if c not in b_mapa.keys():
- b_mapa.update({c: 1})
- else:
- b_mapa.update({c: b_mapa.get(c) + 1})
- if a_mapa == b_mapa:
- print("Anagram!")
- else:
- print("Ne e anagram!")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement