Answer:
The program in Python is as follows:
def swap(number1,number2):
number1,number2 = number2,number1
return number1, number2
first = int(input("First: "))
second = int(input("Second: "))
print("You input the numbers as ",first,"and",second)
first,second= swap(first,second)
print("After swapping\\First: ",first,"\\Second:",second)
Step-by-step explanation:
This defines the function
def swap(number1,number2):
This swaps the numbers
number1,number2 = number2,number1
This returns the swapped numbers
return number1, number2
The main begins here
This gets input for first
first = int(input("First: "))
This gets input for second
second = int(input("Second: "))
Print the number before swapping
print("You input the numbers as ",first,"and",second)
This swaps the numbers
first,second= swap(first,second)
This prints the numbers after swapping
print("After swapping\\First: ",first,"\\Second:",second)