Skip to content

Commit 1a0e5f4

Browse files
Update solution.py
For error handling in case someone pases other types
1 parent 31926cb commit 1a0e5f4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

python/test_challenge/solution.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
def add_numbers(a, b):
2+
if not isinstance(a, int) or not isinstance(b, int):
3+
raise TypeError("Both inputs must be integers")
24
return a + b

0 commit comments

Comments
 (0)