In [29]:
animals = ["cat", "cow", "dog", "bull"]
my_information = {"name" : "JY", "phone_num" : "010-9354", "email" : "jiyong"}

In [7]:
for i in animals:
    print i


cat
cow
dog
bull

In [27]:
for my_information in my_information.items():
    key, value = my_information  #대입 연산자
    print key
    print value


phone_num
010-9354
name
JY
email
jiyong

In [30]:
for key, value in my_information.items():
    print key
    print value


phone_num
010-9354
name
JY
email
jiyong

In [80]:
friends = ["jy","jd","ey","hy"]

In [53]:
for i in range(len(friends)):
    if i == 2:
        friends[i] = "Gd"
    print(friends[i])


jy
jd
Gd
hy

In [71]:
friends.index("jy")


Out[71]:
0

In [81]:
for i in friends:
    index = friends.index(i)
    if index == 3:
        friends[index] = "GD"
    print friends[index]


jy
jd
ey
GD

In [82]:
for i in enumerate(friends):
    print i


(0, 'jy')
(1, 'jd')
(2, 'ey')
(3, 'GD')

In [78]:
for index, value in enumerate(friends):
    if index == 3:
        friends[index] = "GD"
    print friends[index]


jy
jd
ey
GD