<jupyter_start><jupyter_text>[View in Colaboratory](https://colab.research.google.com/github/gmihaila/snippets_py/blob/master/check_if_strings_are_anagrams.ipynb)  Checking if two words are anagrams<jupyter_code>from collections import Counter

str1 = "cat"
str2 = "tac"

Counter(str1) == Counter(str2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11746987951807229, 'fraction_numerical': 0.012048192771084338, 'mean_word_length': 8.25, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '590543', 'license': 'MIT', 'n_tokens_mistral': 134, 'n_tokens_neox': 126, 'n_words': 18, 'path': 'python/jupyter_snippets/check_if_strings_are_anagrams.ipynb', 'repo_name': 'laviniaflorentina/unt_hpc', 'size': '332'}