Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
Python
0/50 solved · 0%
All lessons
lesson
code
Collections · easy
9. Tuples and unpacking
Fixed-size records and unpacking.
Write `swap(a, b)` returning a tuple `(b, a)` using tuple unpacking.
Required in your answer:
def swap
Reveal solution
Run & check
Reset
Runs via Pyodide
def swap(a, b): # TODO: return b, a pass
Output appears here.
← 8. List comprehensions
10. Sets →