MCPcopy Create free account
hub / github.com/geekcomputers/Python / swap_tuple_unpacking

Method swap_tuple_unpacking

swap.py:39–46  ·  view source on GitHub ↗

Swaps the values of x and y using a tuple unpacking method.

(self)

Source from the content-addressed store, hash-verified

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 """

Callers 1

swap.pyFile · 0.80

Calls 1

display_valuesMethod · 0.95

Tested by

no test coverage detected