Home / Python Tips Generated By ChatGPT / Swapping Values in Python Swap the values of two variables in a single line. Source Code a = 5 b = 10 a, b = b, a print("a:", a, "b:", b)