Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

tuples vs list

# A tuple might contain data about a person (heterogeneous type mixture)
person_a = (name, age, occupation, address)

# A list might contain a list of people (homogeneous type mixture - all tuples!)
people = [person_a, person_b, person_c]
Source by teamtreehouse.com #
 
PREVIOUS NEXT
Tagged: #tuples #list
ADD COMMENT
Topic
Name
1+4 =