### 1 ###
for data in (2, 45, 55, 200, -100, 99, 37, 10284):
    if data % 3 == 0:
        print data


### 2 ###
test = "this is test string"
test = test[::-1]
print(test)

### 3 ###
friends = ['john', 'pat', 'gary', 'michael']
num = [1,2,3,4]
print"No. %d is %s" % (num[0],friends[0])
print"No. %d is %s" % (num[1],friends[1])
print"No. %d is %s" % (num[2],friends[2])
print"No. %d is %s" % (num[3],friends[3])


### 4 ###
for x in range(2,10):
    for y in range(1,10):
        print(x),"X",(y),"=",(x*y)

### 5 ###
def greet(bob):
    return bob
bob = "hello bob"
def greet(john):
    return john
john = "hello john"
print(bob)
print(john)

    
### 6 ###
temperature = input("temperature : ")
if temperature >= 72:
    print "too hot"
else:
    print "too cold";

### 7 ###
import urllib
url = "http://c1.img.netmarble.kr/web/netmarble/main/v/img/logo.gif"
data = urllib.urlopen(url).read()
#imgfile = "netmarble-logo.gif"
f = open("d:/netmarble-logo.gif","w")
f.write(data)

### 8 ###
import time
now = time.localtime()
print "today : %d-%d-%d %d:%d:%d" %(now.tm_year,now.tm_mon,now.tm_mday,now.tm_hour,now.tm_min,now.tm_sec)








