Miscellaneous

Swap 2 variables

a, b = b, a

Clear variables

# Clear (without confirmation) a variable from workspace
del <var>
%reset_selective <var>
# Check if available and then delete
if '<var>' in globals(): del <var>
# use locals() inside a def
# Clear all variables
%reset # with confirmation
%reset -f # without confirmation

References