• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by @arijit87


10 Jul, 2024

Updated at 27 Dec, 2024

Write a program to check if the given strings are anagram or not

def check(s1, s2):

?

? ? ?if(sorted(s1)== sorted(s2)):

? ? ? ? ? ? ? print("The strings are anagrams.")

? ? ?else:

? ? ? ? ? ? ? print("The strings aren't anagrams.")

?

s1 = input("Enter string1: ")

# input1: "listen"

s2 = input("Enter string2: ")

# input2: "silent"

check(s1, s2)

# Output: the strings are anagrams.