Python basics data structures
Title: Python Basics: Data Structures
Date: 2017-10-26 13:26
Modified: 2017-10-30 13:26
Category: Python
Tags: python, basics
Slug: python-basics-data-structures
Authors: Max
Summary: Lists, tuples, dictionaries and sets.
List¶
ordered, mutable
x = []
y = [1,2]
print type(x)
print type(y)
Tuple¶
ordered, immutable
x = ()
y = (1,2)
print type(x)
print type(y)
Dictionary¶
unordered, mutable
x = {}
y = {'name': 'MaX', 'subject': "Data Science"}
print type(x)
print type(y)
Set¶
unordered, mutable, unique
x = {1,2,3,3,4}
print x
print type(x)