Python Coding

Published: 29 July 2024
on channel: Work With Python
246
like

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))


On this page of the site you can watch the video online Python Coding with a duration of hours minute second in good quality, which was uploaded by the user Work With Python 29 July 2024, share the link with friends and acquaintances, this video has already been watched 246 times on youtube and it was liked by like viewers. Enjoy your viewing!