You are on page 1of 2

Experiment No.

Aim: Write a program to swap Two Numbers using functions.


Objective:
● To study the basics of python programming.
Outcome: Students will be able to implement the basics of python programming.
Algorithm\Implementation Steps\Installation Steps:
1. Define a function swap and call the function.
2. Get the first number
3. Get the second number
4. Print the numbers before swapping
5. Assign the first number with temporary variable ‘temp’
6. Store the second number to the first number
7. Reassign the second number to the temporary variable
8. Print the Swapped values.

Source Code:
Input and Output:

Conclusion: Thus the Python programs to exchange the values between two variables are
executed successfully and the output is verified.

You might also like