CodeTestValidate

No installations needed! Write Python directly in your browser and get instant feedback with our smart validation system.

Challenge # 8

Check Anagrams

Objective

Determine whether two given strings are anagrams.

Instructions

  • You are given two string variables: str1 and str2.

  • Two strings are anagrams if they contain the same characters with the same frequencies, but possibly in different orders.

  • Check if str1 and str2 are anagrams of each other.

  • Print Anagram if they are, otherwise print Not anagram.

Constraints:
Do not use input(). • Both variables are strings consisting of lowercase letters only.
Exemple IO

Input: str1 = "listen" str2 = "silent"

Output: Anagram

Input: str1 = "triangle" str2 = "integral"

Output: Anagram

Input: str1 = "hello" str2 = "world"

Output: Not anagram

Try It Online!

Output:

Validate Your Results

Get your code reviewed and validated to understand what you did right and where you can improve.

Previous challengeMerge Two DictionariesNext challengeFind Square Root Without math.sqrt
Loading...