Home/Support/Support Forum/I need output for the following basic python program
New and improved user forum site coming soon
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

I need output for the following basic python program

0 votes
Source Code Using a temporary variable in python

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

Reference : https://nareshit.com/python-online-training/

# 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))
asked Jun 15, 2020 in ConnectWare Manager by Narendra New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
I think the output is we have given any values so the output is swapping means x=y and y=x.

Student deals
answered Jun 16, 2020 by markcoblin New to the Community (1 point)