print 'Adam:'+str(d.get('Adam'))
print 'Lisa:'+str(d.get('Lisa'))
print 'Bart:'+str(d.get('Bart'))
print 'Lisa:'+str(d.get('Lisa'))
print 'Bart:'+str(d.get('Bart'))
2016-05-26
for x in [1,2,3,4,5,6,7,8,9 ]:
for y in [ 0,1,2,3,4,5,6,7,8,9 ]:
if x<y:
print 10*x+y
for y in [ 0,1,2,3,4,5,6,7,8,9 ]:
if x<y:
print 10*x+y
2016-05-26
arr = (['a','b'],['c','d'],'e')
>>> print arr
(['a', 'b'], ['c', 'd'], 'e')
>>> print arr[0][1]
b
>>> print arr
(['a', 'b'], ['c', 'd'], 'e')
>>> print arr[0][1]
b
2016-05-26
def result(x):
if x==1:
return 1;
elif x<1:
return 0;
else:
return option(x)+result(x-1)
def option(x):
if x==1:
return 1;
else:
return option(x-1)+3;
print (result(100))
if x==1:
return 1;
elif x<1:
return 0;
else:
return option(x)+result(x-1)
def option(x):
if x==1:
return 1;
else:
return option(x-1)+3;
print (result(100))
2016-05-26
r'''Python is created by "Guido". It is free and easy to learn . Let's start lean Python in imooc!'''
结果
'Python is created by "Guido". It is free and easy to learn . Let\'s start lean Python in imooc!'
不加print
结果
'Python is created by "Guido". It is free and easy to learn . Let\'s start lean Python in imooc!'
不加print
2016-05-26
L = []
for x in range(1,101):
L.append(x*x)
print sum(L)
for x in range(1,101):
L.append(x*x)
print sum(L)
2016-05-26