Home Coding Data Structure

Data Structure

0
Data Structure

# # DATA STRUCTURE
# We use data structure if we need to collect multiple values.
# Just think about a big cardboard box full of other items.
# The outer box it's a Data Structure, and what you have 
# inside are objects.
# Like in the real world, boxes can contain different
# types of objects.
# Python's 4 built-in data structures are
# list, tuple, set, and dictionary.

# I'm a list, a list of same objects
dataStrucure1 = [1,2,3,4]
 
# I'm a list too, but I can contain different objects
dataStrucure2 = [1,"a",None,"Hello"]

# My names is tuple, I'm similar but different from a list
dataStrucure3 = ("one","two","3",4)  

# I'm a set, I'm like a tuples. Not really, but we will see it 
# later, just check the output order
dataStrucure4 = {"first","second","third",4} 

# I'm a Dictionary, like in a real-world, you
# have an index or key and a description or value

dataStrucure5 = {"name": "Jhon",
						"second name": "Smith",
						"age": 42}           

# copy www.AEC.codes
OUT = (dataStrucure1 ,dataStrucure2 ,dataStrucure3 ,dataStrucure4 , dataStrucure5 )