Source Code: Using a temporary variable
# Python program to swap two variables
x = 5
y = 10
# To take inputs from the user
#x = input('Enter value of x: ')
#y = input('Enter value of y: ')
# create a temporary variable and swap the values
temp = x
x = y
y = temp
print('The value of x after swapping: {}'.format(x))
print('The value of y after swapping: {}'.format(y))
Reference :
https://nareshit.com/python-online-training/

Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jul 8, 2020, 6:24 AM EDT
Farhan AhmedRank #73 · 25K reputationPosted Jul 8, 2020, 6:24 AM EDT
Veena SardaRank #79 · 24.5K reputationPosted Jul 8, 2020, 8:26 AM EDT
Ajay GohilRank #2,370 · 599 reputationPosted Jul 10, 2020, 2:27 AM EDT
Vijayakumar SRank #721 · 3.3K reputationPosted Jul 12, 2020, 6:13 PM EDT