Quizes
Problems
Courses
Sign
Register
Main
/
Courses
/
Basics of Python
/
ARITHMETIC EXPRESSIONS
ARITHMETIC EXPRESSIONS
№ 5
/12
Exchange of variables
Read Theory
Task
Given two variables that are entered from the keyboard. It is necessary to interchange the values of these variables: in the variable a, what was previously stored in b should be written, and in the variable b, what was previously stored in a should be written. Then these variables are output, first the variable a, then b
Complete the program with the necessary operators.
Prohibited operators:
a, b = b, a;a,b = b,a;a,b = b,a;a, b = b,a;a,b = b, a
Python
1
a, b = map(int, input().split())
2
#
3
#
4
#
5
print(a, b)
Your last submission is saved in the editor window.
Results:
All results: