Swap Variables
Start Timer
0:00:00
You are given a dictionary with two keys a
and b
that hold integers as their values.
Without declaring any other variable, swap the value of a
with the value of b
and vice versa.
Note: Return the dictionary after editing it.
Example:
Input:
numbers = {
'a':3,
'b':4
}
Output:
def swap_values(numbers) -> {'a':4,'b':3}
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments