d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for x in d.values():
sum += x
print sum / len(d)
sum = 0.0
for x in d.values():
sum += x
print sum / len(d)
2018-04-01
"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.
2018-04-01
大家如果根据老师给的提示还是没有成功的,可以重启下计算机就好了,我搞了一晚上,结果只要重启下就好了,也是醉了。Win7系统可以去百度
2018-04-01
def firstCharUpper(s):
return s[:1].upper() + s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
return s[:1].upper() + s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
2018-03-31
s = 'Python was started in 1989 by "Guido".\nPython is free and easy to learn.'
print s
print s
2018-03-31
s = set([('Adam', 95), ('Lisa', 85), ('Bart', 59)])
for x in s:
print x[0],':',x[1]
for x in s:
print x[0],':',x[1]
2018-03-31
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for key in d:
print str(key),':',str(d[key])
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for key in d:
print str(key),':',str(d[key])
2018-03-31