Title 1 title 2


In [3]:
print 'hello'


hello

In [4]:
a = 1 
print a


1

In [5]:
a + 2


Out[5]:
3

In [6]:
b = 3.14 
print b


3.14

In [8]:
b + a


Out[8]:
4.140000000000001

In [9]:
print C


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-e2259c918884> in <module>()
----> 1 print C
      2 

NameError: name 'C' is not defined

In [10]:
c = 'mon' print c


  File "<ipython-input-10-193d669279db>", line 1
    c = 'mon' print c
                  ^
SyntaxError: invalid syntax

In [11]:
c = 'mon'
print c


mon

In [ ]:


In [12]:
c + a


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-084962d40380> in <module>()
----> 1 c + a

TypeError: cannot concatenate 'str' and 'int' objects

In [13]:
a, b, c


Out[13]:
(1, 3.14, 'mon')

In [14]:
for a in ragne (0, 10 1): 
    print i


  File "<ipython-input-14-941b06f6257f>", line 1
    for a in ragne (0, 10 1):
                          ^
SyntaxError: invalid syntax

In [15]:
for i in range(0, 10,1):
    print i


0
1
2
3
4
5
6
7
8
9

In [16]:
for i in range (0,100,5):
    print i


0
5
10
15
20
25
30
35
40
45
50
55
60
65
70
75
80
85
90
95

In [17]:
for i in range (1, 10, 1):
    print i


1
2
3
4
5
6
7
8
9

In [18]:
i = 0
while i < 10: 
    print i
    i = i + 1


0
1
2
3
4
5
6
7
8
9

In [19]:
for i in range(0,10,1):
    if i == 3:
        print 'we have 3'
        elif i>3:
            print 'we have many'
            else
            print 'we have few'


  File "<ipython-input-19-23af721106f6>", line 4
    elif i>3:
       ^
SyntaxError: invalid syntax

In [20]:
for i in range (0,10,1):
    if i == 3:
        print 'we have 3'
    if i>3: 
        print 'we have many'
    if i<3:
        print 'we have few'


we have few
we have few
we have few
we have 3
we have many
we have many
we have many
we have many
we have many
we have many

In [21]:
[1, 2, 3]


Out[21]:
[1, 2, 3]

In [22]:
alist = [1,2,3]

In [23]:
alist[1]


Out[23]:
2

In [24]:
atuple = (1, 2, 3)

In [25]:
dico = {'key1': 1, 'key2': 3}

In [26]:
dico


Out[26]:
{'key1': 1, 'key2': 3}

In [27]:
dico['key1']


Out[27]:
1

In [ ]: