I need output for the following basic python program
Title
Question
Source Code Using a temporary variable in<a href="https://nareshit.com/python-online-training/" target="" title=""> Python</a>
# 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))
Reference : https://nareshit.com/python-online-training/
Python Getting-started-with-ipython 01-02 min 0-10 sec
Answers:
<span style="background-color: rgb(250, 250, 250);">Output:</span>
<span style="background-color: rgb(250, 250, 250);">
</span>
</span>
<span style="background-color: rgb(250, 250, 250);">The value of x after swapping: 10 </span>
<span style="background-color: rgb(250, 250, 250);">The value of y after swapping: 5</span>
Login to add comment