Swapping of two numbers in python | IDLE SHELL | PYTHON

Publié le: 11 février 2023
sur la chaîne: We Are Programmers
95
3

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


Sur cette page du site, vous pouvez voir la vidéo en ligne Swapping of two numbers in python | IDLE SHELL | PYTHON durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur We Are Programmers 11 février 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 95 fois et il a aimé 3 téléspectateurs. Bon visionnage!