AI engineering glossary · Python core
What is sequence?
Sequence: An ordered collection whose items are reached by integer position and that supports len(), indexing and slicing. Lists, tuples, strings and ranges are sequences, while sets and dictionaries are not.
Sequence: an example
len('hello') is 5 and 'hello'[1:3] is 'el'; both work on any sequence, including [10, 20, 30] and range(5).
Related terms
More Python core terms
Where you learn it
Sequence is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.