Question: 1 Q1) The following Python program swaps two variables which is entered by user begin{tabular}{[11] hline # To take input from the user $x=$ input

 1 Q1) The following Python program swaps two variables which is

1 Q1) The following Python program swaps two variables which is entered by user \begin{tabular}{[11] \hline # 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$ )) \hline \end{tabular Based on the code given above, re-write it to perform swapping only when $x>y$, otherwise do nothing. CS.VS. 1100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!