Skip to content

Commit cdbad58

Browse files
author
krsm
committed
Adding TypeError verification
1 parent d7f7ae4 commit cdbad58

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Unitests/pystest_stdy/capitalize.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"""
77

88

9-
def capitalize_string(str):
10-
return str.capitalize()
9+
# it will receive a string and capitalize
10+
def capitalize_string(s):
11+
if not isinstance(s, str):
12+
raise TypeError('Please provide a string argument')
13+
else:
14+
return s.capitalize()
15+
1116

0 commit comments

Comments
 (0)