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 33169cb

Browse files
committed
added \s to test to pass when space is added
1 parent 1eba37a commit 33169cb

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

‎exercises/10-Array-Methods/app.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan']
22
## CREATE YOUR FUNCTION HERE
33

4-
54
print(sort_names(names))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def sort_names (arr):
2+
return sorted(arr)

‎exercises/10-Array-Methods/tests.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def test_declare_variable():
55
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
66
with open(path, 'r') as content_file:
77
content = content_file.read()
8-
regex = re.compile(r"def sort_names\(.*\)\:")
8+
regex = re.compile(r"def sort_names\s\(.*\)\:")
99
assert bool(regex.search(content)) == True
1010

1111

0 commit comments

Comments
(0)

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