MohdMubasshir
MohdMubasshir MohdMubasshir
  • 24-09-2020
  • Computers and Technology
contestada

15. Write a program in python to read three numbers in three variables and swap first two variables with the sums of
first and second, second and third numbers respectively.​

Respuesta :

tonb
tonb tonb
  • 24-09-2020

Answer:

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))

c = int(input("Enter third number: "))

a,b = a+b,b+c

print(a,b,c)

Explanation:

Assignments like this are easy in python, in the sense that no helper variables are needed!

Answer Link

Otras preguntas

Saturated fats that are found in avocados are good and should not be limited. True False
how much energy does the sun give off?
A 15-foot pole is leaning against a tree. The bottom of the pole is 8 feet away from the bottom of the tree. Approximately how high up the tree does the top of
What is the reduced form of 25/50
Which of the following is equivalent to (cd)5? c5d cd5 c5d5 5cd
In "The Fiery Furnace," why does the Babylonian king give Shadrach, Meshach, and Abednego even greater power and order others to respect their beliefs after the
please answer 123 and show work thanks
This U.S. government agency decided to overthrow Fidel Castro in the early 1960s. FBI NSC NIS CIA
Which description of Andrew Jackson is correct? A. He was the first common man to be elected president. B. He appointed Lewis and Clark to explore the West.
Dawn is making an abstract painting with two triangles. The dimensions of the painting are shown below: Two triangles share the same height of 8 inches. One tr