Define a function named swap_values that takes four integers as parameters and swaps the first with the second, and the third with the fourth values. Then write a main program that reads four integers...


Python


Look at image.



Define a function named swap_values that takes four integers as parameters and swaps the first with the second, and the third with the<br>fourth values. Then write a main program that reads four integers from input, calls function swap_values() to swap the values, and prints<br>the swapped values on a single line separated with spaces.<br>Ex: If the input is:<br>3<br>8.<br>4<br>function swap_values() returns and the main program outputs:<br>8 3 4 2<br>The program must define and call the following function.<br>def swap_values (user_vall, user_val2, user_val3, user_val4)<br>

Extracted text: Define a function named swap_values that takes four integers as parameters and swaps the first with the second, and the third with the fourth values. Then write a main program that reads four integers from input, calls function swap_values() to swap the values, and prints the swapped values on a single line separated with spaces. Ex: If the input is: 3 8. 4 function swap_values() returns and the main program outputs: 8 3 4 2 The program must define and call the following function. def swap_values (user_vall, user_val2, user_val3, user_val4)

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here