d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for k, v in d.items():
sum = sum + v
print k,':',v
print 'average', ':', sum/len(d)
sum = 0.0
for k, v in d.items():
sum = sum + v
print k,':',v
print 'average', ':', sum/len(d)
2015-04-02
def firstCharUpper(s):
return s[0].upper()+s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
return s[0].upper()+s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
2015-04-02
print r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.'''
Whether it's nobler in the mind to suffer.'''
2015-04-01
最赞回答 / BlueCube13
相当于是先把n-1个盘子移到b上,然后把a上剩下的最大的那个盘子移动到c上,再把b上的n-1个盘子移到c上,这三个参数其中第一个参数相当于是移动的起始位置,第二个参数相当于是经由的位置(因为为了不让大盘子压小盘子,就必须借助另一根柱子),第三个参数相当于是最终的目的地,所以就换成了a,c,b表示把a上的盘子挪到b上,借助c
2015-04-01
最新回答 / dev_林杰
>>> t = range(10)>>> t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> >>> tuple(t)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)>>> t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> 记得好评哦 亲
2015-04-01