Skip to content

Commit 0e98f1a

Browse files
committed
Improve docstring clarity for anagram check function
1 parent 241f9c8 commit 0e98f1a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

strings/check_anagrams.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77

88
def check_anagrams(first_str: str, second_str: str) -> bool:
99
"""
10-
Two strings are anagrams if they are made up of the same letters but are
11-
arranged differently (ignoring the case).
10+
Check whether two strings are anagrams of each other.
11+
12+
Two strings are anagrams if they contain the same characters
13+
with the same frequency, ignoring case and whitespace.
14+
15+
:param first_str: first input string
16+
:param second_str: second input string
17+
:return: True if strings are anagrams, False otherwise
18+
1219
>>> check_anagrams('Silent', 'Listen')
1320
True
1421
>>> check_anagrams('This is a string', 'Is this a string')

0 commit comments

Comments
 (0)