Skip to content

Commit

Permalink
Added float intakes also.
Browse files Browse the repository at this point in the history
  • Loading branch information
NitkarshChourasia authored Jul 26, 2023
1 parent 95a57df commit 8c00538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, x, y):
The second value to be swapped.
"""
if not isinstance(x, int) or not isinstance(y, int):
if not isinstance(x, (int, float)) or not isinstance(y, (float, int)):
raise ValueError("Both x and y should be integers.")

self.x = x
Expand Down

0 comments on commit 8c00538

Please sign in to comment.