Question: The following Python program swaps two variables which is entered by user # To take input from the user x = input ('Enter value
The following Python program swaps two variables which is entered by user # To take input 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: ',x)) print ('The value of y after swapping: ',y)) Based on the code given above, re-write it to perform swapping only when x>y, otherwise do nothing.
Step by Step Solution
There are 3 Steps involved in it
Take input from the user x intinputEnter value of x y ... View full answer
Get step-by-step solutions from verified subject matter experts
