Académique Documents
Professionnel Documents
Culture Documents
in Python
Girls Who Code
Lists and Tuples
Lists and tuples are different types of data
collections.
https://www.programiz.co
m/python-programming/
methods/list
Tuples
Tuples are collections of data that are ordered
and unchangeable. They are initialized and
declared using parentheses rather than brackets.
Creating tuples:
Items in Tuples are
Unchangeable
Once you create a tuple and set its values, you
cannot change the value of the items.
Accessing Items in Tuples
To access or call on items in a tuple, refer to the
index number inside square brackets.
Tuple Functions
Check
To check if an item exists in
a tuple, use the word “in”
with “if” statements.
Tuple Length
To get the length of a
tuple, use the statement
“len ( thisTuple )”
Other Tuple Methods
Count Method
Index Method
Python Tuple Lessons and More
https://www.w3schools.co
m/python/python_tuples.a
sp
Referenced Websites
- https://www.w3schools.com/python/python_lists.asp
- https://www.w3schools.com/python/python_tuples.asp
-
Lists and Tuples
del nameOfList [ 0 ]
nameOfList.pop ( )