我要再对慕课说一句 来这的不只有“官人”和“偶吧”,不能这样的,妹子也是可以有敲两行代码的权利的
2015-07-09
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[2]
print L[0]
print L[1]
print L[2]
print L[2]
2015-07-08
L = []
for i in range(1, 101):
s = i**2
L.append(s)
print sum(L)
for i in range(1, 101):
s = i**2
L.append(s)
print sum(L)
2015-07-08
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in L:
if i in s:
s.remove(i)
else:
s.add(i)
print s
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for i in L:
if i in s:
s.remove(i)
else:
s.add(i)
print s
2015-07-08
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for key in d:
print key,':',d[key]
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for key in d:
print key,':',d[key]
2015-07-08
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
d['Paul'] = 75
print d
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
d['Paul'] = 75
print d
2015-07-08
for x in range(1, 10):
for y in range(10):
if x < y:
print x * 10 + y
else:
continue
for y in range(10):
if x < y:
print x * 10 + y
else:
continue
2015-07-08