Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "naina":"naani"
- print "Find anagram !\n"
- def anagram():
- str1='naina'
- str2='naina'
- list1=list(str1)
- list2=list(str2)
- list1.sort()
- list2.sort()
- print list1,list2
- position=0
- matches=True
- if len(list1)==len(list2):
- while position < len(list1) and matches:
- if list1[position] == list2[position]:
- position =position +1
- else:
- matches =False
- return matches
- return "length is equal "
- else:
- return "not equal"
- print anagram()
Add Comment
Please, Sign In to add comment