Intro

This tutorial will cover some basic Python skills including numpy matplotlib and pickle mudules. Python has so many datatypes. However, there are three useful datatypes you need to known: tuple, list and dictionary.


In [6]:
mytuple=(7,"text",'i')
print mytuple[0]
print mytuple[1]
print mytuple[2]


7
text
i

In [9]:
mylist=[1,2]
mylist.append("text")
print mylist
print mylist.pop()
print mylist.pop(0)
print mylist.pop()


[1, 2, 'text']
text
1
2

In [5]:
mydict={"key":"value", 1:"str", "word":123}
print mydict["key"]
print mydict[1]
print mydict["word"]


value
str
123

In [ ]: