Swaps the values of x and y using a tuple unpacking method.
(self)
| 37 | print(f"{message} x: {self.x}, y: {self.y}") |
| 38 | |
| 39 | def swap_tuple_unpacking(self): |
| 40 | """ |
| 41 | Swaps the values of x and y using a tuple unpacking method. |
| 42 | |
| 43 | """ |
| 44 | self.display_values("Before swapping") |
| 45 | self.x, self.y = self.y, self.x |
| 46 | self.display_values("After swapping") |
| 47 | |
| 48 | def swap_temp_variable(self): |
| 49 | """ |