def is_anagram(t,u):
if sorted(t)== sorted (u):
return True
else:
return False
print is_anagram('realtor', 'rotlear') # True
print is_anagram('superpuff','local') # False
print is_anagram('alla', 'lala') # True
print is_anagram('tools', 'stool') # True
print is_anagram('double', 'trouble') # False
jeremywduncan -1 Newbie Poster
Lucaci Andrew commented: Think Python - Exercise 10.7 - THINK BEFORE YOU POST! -1
snippsat 661 Master Poster
jeremywduncan -1 Newbie Poster
Ene Uran 638 Posting Virtuoso
jeremywduncan -1 Newbie Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.