Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 318 Bytes

16-tuples.md

File metadata and controls

17 lines (12 loc) · 318 Bytes

Commands used in the Egghead.io Series Intro to Python

Lesson Sixteen - Create Immutable Values in Python with Tuples

Create a tuple in Python:

t = 'dog', 'cat', 12345
t # returns ('dog', 'cat', 12345)

Access a tuple value by index id:

t[0] # returns 'dog'
t[1] # returns 'cat'