Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Data Structures – Tuples | Python Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. Python Fundamentals

Lesson 15 of 55

·Python

Data Structures – Tuples

20 minutes

Course progress27%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • Tuples are immutable sequences, defined with parentheses.
  • Useful for records that shouldn’t change.
  • Single‑element tuples need a trailing comma (`(42,)`).
  • Can be unpacked directly into variables.

Data Structures – Tuples

Tuples are ordered, immutable collections. Because they cannot be changed after creation, they’re ideal for fixed groups of items (e.g., coordinates).

point = (10, 20)
# Unpack the tuple
x, y = point
print('x =', x, ', y =', y)

# Single‑element tuple needs a trailing comma
single = (42,)
print(single)

Even though you can’t modify a tuple, you can concatenate or repeat them to produce new tuples.

Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Python FundamentalsBrowse activities
Previous lessonList ComprehensionsContinue to lesson 16Data Structures – SetsBack to Python Fundamentals curriculum