for x in ['1','2','3','4','5','6','7','8','9']:
for y in ['0','1','2','3','4','5','6','7','8','9']:
if x >= y:
continue
print x + y
for y in ['0','1','2','3','4','5','6','7','8','9']:
if x >= y:
continue
print x + y
2018-04-23
L = ['Adam', 'Lisa', 'Bart']
L.reverse()
print L
L.reverse()
print L
2018-04-23
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.remove('Paul')
L.remove('Bart')
print L
L.remove('Paul')
L.remove('Bart')
print L
2018-04-23
sum = 0
x = 0
while x < 100:
x = x + 1
if x % 2 == 0:
continue
sum = sum + x
print sum
x = 0
while x < 100:
x = x + 1
if x % 2 == 0:
continue
sum = sum + x
print sum
2018-04-23
sum = 0
x = 1
n = 1
while True:
sum = sum+x
x = x*2
n = n+1
if n >20:
break
print sum
x = 1
n = 1
while True:
sum = sum+x
x = x*2
n = n+1
if n >20:
break
print sum
2018-04-23
sum = 0
n = 0
while True:
... x = 2**n
... sum = sum + x
... n = n + 1
... if n > 19:
... break
...
>>> print sum
n = 0
while True:
... x = 2**n
... sum = sum + x
... n = n + 1
... if n > 19:
... break
...
>>> print sum
2018-04-23
sum = 0.0
# for x in d.values():
# sum = sum + x
# for x,y in d.items():
# sum = sum + y
for z in d:
sum = sum + d[z]
print sum/len(d)
复习一遍,dict遍历的各种方式
# for x in d.values():
# sum = sum + x
# for x,y in d.items():
# sum = sum + y
for z in d:
sum = sum + d[z]
print sum/len(d)
复习一遍,dict遍历的各种方式
2018-04-23