subject

Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is:
3 8
the output is:
8 3
Your program must define and call the following function. swap_values() returns the two values in swapped order.
def swap_values(user_val1, user_val2)
def swap_values(user_val1, user_val2):
swap_values(user_val1, user_val2)
return user_val1, user_val2
if __name__ == '__main__':
user_val1 = input()
user_val2 = input()
temp = user_val1
user_val1 = user_val2
user_val2 = temp
print(user_val1, user_val2)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:20, codie1103
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, bryanatwin1536
Describir textbook icon_person mira los dibujos y describe lo que está pasando. usa los verbos de la lista.
Answers: 1
image
Computers and Technology, 23.06.2019 04:40, Koriunaa
The narrative structure of the popular movies can be broken down into
Answers: 3
image
Computers and Technology, 23.06.2019 09:00, Riddledjam44623
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
You know the right answer?
Write a program whose input is two integers and whose output is the two integers swapped. Ex: If th...

Questions in other subjects:

Konu
Mathematics, 22.08.2019 11:30