print r'''"To be, or not to be": that is the question.\nWhether it's nobler in the mind to suffer.'''
2017-02-25
def generate_tr(name, score):
css = ''
if score<60 : css=' style="color:red"'
return '<tr><td>%s</td><td%s>%s</td></tr>' % (name, css, score)
css = ''
if score<60 : css=' style="color:red"'
return '<tr><td>%s</td><td%s>%s</td></tr>' % (name, css, score)
2017-02-24
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59,
}
insert(0,"'paul':75")
'Adam': 95,
'Lisa': 85,
'Bart': 59,
}
insert(0,"'paul':75")
2017-02-24
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[-1]
print L[0]
print L[1]
print L[2]
print L[-1]
2017-02-24
print 'hello,python'
name = input('输入你的名字')
print ('hello',name)
name = input('输入你的名字')
print ('hello',name)
2017-02-24
def average(*args):
sum = x = 0
if args:
for num in args:
sum = sum + num
x = x + 1
aver = sum*1.0/(x*1.0)
return aver
else:
return 0.0
sum = x = 0
if args:
for num in args:
sum = sum + num
x = x + 1
aver = sum*1.0/(x*1.0)
return aver
else:
return 0.0
2017-02-24