Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fcbcfbe

Browse files
author
Amogh Singhal
authored
Create is_anagram.py
1 parent b4d4528 commit fcbcfbe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎is_anagram.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Check if two strings are anagrams of each other
2+
3+
def is_anagram(str1, str2):
4+
5+
if len(str1) == len(str2):
6+
for i in str1:
7+
if i in str2:
8+
pass
9+
else:
10+
return False
11+
return True
12+
else:
13+
return False
14+
15+
result = is_anagram("hello", "billion")
16+
print(result) # False

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /