Skip to content

Commit 7aafe26

Browse files
Merge pull request #1942 from NitkarshChourasia/improvements
Improvements
2 parents a97d18a + 05c9cde commit 7aafe26

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

Swap numbers.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

swap.py

Lines changed: 1 addition & 1 deletion
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)