Swapping of two numbers in python | IDLE SHELL | PYTHON

Pubblicato il: 11 febbraio 2023
sul canale di: 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))


In questa pagina del sito puoi guardare il video online Swapping of two numbers in python | IDLE SHELL | PYTHON della durata di ore minuti seconda in buona qualità , che l'utente ha caricato We Are Programmers 11 febbraio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 95 volte e gli è piaciuto 3 spettatori. Buona visione!