Your question is Implement Variable Swap in Python. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
In a Crédit Agricole CIB market-data preprocessing step, two locally held values may need to exchange positions. Implement a function that swaps two Python values and returns them in reversed order.
The function must use Python tuple unpacking rather than an explicit temporary variable. It must not modify any external data structure, and the original argument variables do not need to change because Python arguments are passed by assignment.
Implement swap_values(first, second).
first and second. The values may be integers, strings, floats, or other directly assignable Python objects.(second, first) containing the values in swapped order.def swap_values(first, second):