Guide
Python
Beginner
Tuples: Chapter Practice
Apply tuples with a mini lab and knowledge check.
Mini lab
Unpack a host and port pair and print both values.
Expected output: localhost 8080
Hint
Use the chapter examples to choose the operation, then run your version before opening the solution.Show solution
endpoint = ("localhost", 8080)
host, port = endpoint
print(host, port)
Knowledge check
Can a tuple contain a mutable list?
Check your answer
Yes. The tuple references cannot be replaced, but the referenced list can change.Finish the chapter
- Explain each operation without reading the lesson.
- Change the sample input and predict the output before running it.
- Revisit the chapter if the result differs from your prediction.
Add More Questions to This Guide
Know a question that should be here? Share it and help the community!
Open Google Form