In [1]:
l = [ "hello", 12345, [ 123345, 1323, 43434] ]
In [2]:
print l
['hello', 12345, [123345, 1323, 43434]]

In [3]:
print l[0]
hello

In [4]:
print l[2]
[123345, 1323, 43434]

In [6]:
print l[2][2]
43434

In [7]:
print l[2, 2]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-cc0d71862d19> in <module>()
----> 1 print l[2, 2]

TypeError: list indices must be integers, not tuple
In [8]:
print l
['hello', 12345, [123345, 1323, 43434]]

In [10]:
print l[0]
print l[0][2]
print l[0][1]
hello
l
e

In [11]:
for element in l:
    print element
hello
12345
[123345, 1323, 43434]

In [12]:
range(10)
Out[12]:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
In [13]:
range(5, 10)
Out[13]:
[5, 6, 7, 8, 9]
In [14]:
range(5, 10, 2)
Out[14]:
[5, 7, 9]
In [15]:
for i in range(5, 16, 5):
    print "The square of ", i, " is ", i**2
    print "The square root of ", i, " is ", i**0.5
The square of  5  is  25
The square root of  5  is  2.2360679775
The square of  10  is  100
The square root of  10  is  3.16227766017
The square of  15  is  225
The square root of  15  is  3.87298334621

In [16]:
for vowel in 'aeiuyo':
    print vowel
a
e
i
u
y
o

In [24]:
print l[0]
print l[0][-1]
print l[0][1:]
print l[0][2:]
print l[0][1:-1]
print l[0][::2]
print l[0][::-1]
hello
o
ello
llo
ell
hlo
olleh

In [25]:
if 12 < 13:
    print 'yeah'
else:
    print 'hummmm'
yeah

In [26]:
len('hello')
Out[26]:
5
In [27]:
len(l)
Out[27]:
3
In [28]:
l
Out[28]:
['hello', 12345, [123345, 1323, 43434]]
In [29]:
for i in range(len(l)):
    print "l[", i, "] = ", l[i]
l[ 0 ] =  hello
l[ 1 ] =  12345
l[ 2 ] =  [123345, 1323, 43434]

In [30]:
for i,v in enumerate(l):
    print "l[", i, "] = ", v
l[ 0 ] =  hello
l[ 1 ] =  12345
l[ 2 ] =  [123345, 1323, 43434]

In [32]:
list(enumerate(l))
Out[32]:
[(0, 'hello'), (1, 12345), (2, [123345, 1323, 43434])]
In [33]:
l
Out[33]:
['hello', 12345, [123345, 1323, 43434]]
In []: