Back to Lesson
Data Unpacking
Extract elements from a tuple using standard and starred unpacking.
Instructions
- Given
user_data = ("alice_smith", "user", True, "admin", "moderator") - Use unpacking to assign the first element to, the second to
username, and the remaining elements to a list calledroleusing theflagsoperator.* - Print,
username, androleon separate lines.flags
main.py
main.py
Ctrl + Enter