Use multiple assignment to set x to 10 and y to 20 on one 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 10 and y to 20 on one line. Then swap their values using Python's one-line swap (no temp variable). 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.