.. include:: Swap Two Variables ================== .. jf-exercise:: python.basics.exercises.variable :dependencies: python.basics.exercises.boolean, python.basics.python_0140_variables, python.basics.python_0150_datatypes_overview, python.basics.python_0120_helloworld #. Write a program that exchanges (swaps) two variables ``var1`` and ``var2``, both ``str`` type. To output the values before and after the swap operation, use the ``print()`` function like so, .. code-block:: python print('Before:', var1, var2) print('After:', var1, var2) Dependencies ------------ .. jf-topicgraph:: :entries: python.basics.exercises.variable