Initialize the Swapper class with two values. Parameters: ---------- x : int The first value to be swapped. y : int The second value to be swapped.
(self, x, y)
| 16 | """ |
| 17 | |
| 18 | def __init__(self, x, y): |
| 19 | """ |
| 20 | Initialize the Swapper class with two values. |
| 21 | |
| 22 | Parameters: |
| 23 | ---------- |
| 24 | x : int |
| 25 | The first value to be swapped. |
| 26 | y : int |
| 27 | The second value to be swapped. |
| 28 | |
| 29 | """ |
| 30 | if not isinstance(x, (int, float)) or not isinstance(y, (float, int)): |
| 31 | raise ValueError("Both x and y should be integers.") |
| 32 | |
| 33 | self.x = x |
| 34 | self.y = y |
| 35 | |
| 36 | def display_values(self, message): |
| 37 | print(f"{message} x: {self.x}, y: {self.y}") |
nothing calls this directly
no outgoing calls
no test coverage detected