Intro to Sequential Data Types

Learn to Code Today!

Learn 10x faster: coding, no-code and data skills. Join millions of users mastering new tech skills and accelerating their career with Enki.
Get started

This is part of “An intro to Python” series of posts, with content from the Enki app. If you stumbled upon this, you can start from the beginning.

There are several different sequential data types in Python. These are ones that are ordered in a defined sequence.

Strings are an example of a sequential data type.

Elements in sequential data types can be accessed via their indexes.

Indexes are basically measures of position. All elements within a variable start at index 0.

The index used must be valid:

Strings are also an immutable data type which means that items cannot be reassigned.

Most python objects (booleans, integers, floats, strings, and tuples) are immutable. This means that after you create the object and assign some value to it, you can’t modify that value.

Tuples

Tuples are another sequential and immutable data type.

They’re used to group any number of items, regardless of their type, into a single value.

A tuple is created by separating items with commas, and are often wrapped in optional parentheses () to make them stand out.

Again, we can extract elements from tuples using the index operator, and items cannot be reassigned:

Tuples are mostly used when we need to store values of multiple different types, such as for database fields or CSV column names.

Learn More

About Enki

  • Fully personalized online up-skilling
  • Unlimited AI coaching
  • Designed by Silicon Valley experts

More articles

Meet your AI-enabled coach

Professional athletes have a coach for every aspect of their performance. Why can’t you for your work? Enki’s AI-powered coaching on-demand - combined with state of the art, structured learning content - makes this a reality.
1
1:1 AI Coaching
How do I remove duplicate emails?
Convert the list to a set and back to a list. Sets automatically remove duplicates.
2
Personalized Exercises
3
Interactive practice

Unlock full access to all skills on Enki with a 7-day free trial

Get started