Use multiple assignment to set x to 5 and y to 10 in a single line
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Use multiple assignment to set x to 5 and y to 10 in a single line. Then swap their values using Python's one-line swap. Print x and y separated by a space.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.