Swap Two number Program in Python

Prev Tutorial Next Tutorial

Swap Two number Program in Python

For write this program need only print statement for print message on screen and and need three variable first store first variable in second variable and second variable value store in third variable. Finally third variable value store in first variable.

Hello World Program in Python

a = input('Enter value of a: ')
b = input('Enter value of b: ')

temp = a
a = y
b = temp

print('After swapping a: {}'.format(x))
print('After swapping b: {}'.format(y))


Enter value of a: 10
Enter value of b: 20

After swapping a:20
After swapping b:10

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements