print 'hello, python.'
print 'hello,','python.'
print 'hello,'+' python.'
print('hallo, python.')
print 'hallo,','python.'
print('hallo,'' python.')
print 'hello,','python.'
print 'hello,'+' python.'
print('hallo, python.')
print 'hallo,','python.'
print('hallo,'' python.')
2018-09-25
L = ['Adam', 'Lisa', 'Bart']
L[0] ='Bart'
L[2] ='Adam'
print L
这样也可以对吗
L[0] ='Bart'
L[2] ='Adam'
print L
这样也可以对吗
2018-09-25
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(3)
L.pop(2)
print L
可以
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(2)
L.pop(2)
print L
也可以
L.pop(3)
L.pop(2)
print L
可以
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(2)
L.pop(2)
print L
也可以
2018-09-25
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(3)
L.pop(2)
print L
L.pop(3)
L.pop(2)
print L
2018-09-20
print (r'''"To be, or not to be": that is the question.''','\n',r'''Whether it's nobler in the mind to suffer''')
2018-09-20
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(3)
L.pop(2)
print L
这样也阔以
L.pop(3)
L.pop(2)
print L
这样也阔以
2018-09-20
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 }
def generate_tr(name, score):
return '<tr><td>{0}</td><td{2}>{1}</td></tr>'.format(name, score,"" if score>=60 else ' style="color:red"')
tds = [generate_tr(name,score) for name, score in d.iteritems()]
def generate_tr(name, score):
return '<tr><td>{0}</td><td{2}>{1}</td></tr>'.format(name, score,"" if score>=60 else ' style="color:red"')
tds = [generate_tr(name,score) for name, score in d.iteritems()]
2018-09-19
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
print sum(d.values())*1.0/len(d)
print sum(d.values())*1.0/len(d)
2018-09-19
L = range(1, 101)
print L[-10:] #[91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
print L[-1:-51:-5][::-1] #[55, 60, 65, 70, 75, 80, 85, 90, 95, 100]
print L[-1:-11:-1] #[100, 99, 98, 97, 96, 95, 94, 93, 92, 91]
print L[-10:] #[91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
print L[-1:-51:-5][::-1] #[55, 60, 65, 70, 75, 80, 85, 90, 95, 100]
print L[-1:-11:-1] #[100, 99, 98, 97, 96, 95, 94, 93, 92, 91]