Kodewick
Start learning →
Basic←→0 / 112

Swap the Boxes

#105Basica, b = b, a4 min

Two boxes: a holds 3 and b holds 8. Swap them, so that a becomes 8 and b becomes 3. The last line is already written — only the middle step is missing.

Careful: writing a = b on its own throws away the 3 that was in a.

Should show
8 3
main.py
a = 3
b = 8
# your code here: swap the values of a and b
print(a, b)
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.