Skip to content

Commit 8c00538

Browse files
Added float intakes also.
1 parent 95a57df commit 8c00538

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, x, y):
2727
The second value to be swapped.
2828
2929
"""
30-
if not isinstance(x, int) or not isinstance(y, int):
30+
if not isinstance(x, (int, float)) or not isinstance(y, (float, int)):
3131
raise ValueError("Both x and y should be integers.")
3232

3333
self.x = x

0 commit comments

Comments
 (0)