Computer Science, asked by Anonymous, 25 days ago

Write a program to swap two variables. (in python)


(Any python expert here ?)​

Answers

Answered by ojasvii29
14

Here is your answer !

________________

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

_____________________

Actually I'm a beginner ^^

( So please don't mind if I made any mistake in the Answer )

I just started learning python and it has been two weeks I'm continuing with it !

Python is just so dámn amazing :D

Anyways, Take care !!

Answered by kauranmolpreet395
4

Answer:

ùr ãñswer høpe it helps you

ARMY✌️

Attachments:
Similar questions