d = {
95: 'Adam',
85: 'Lisa',
59: 'Bart'
}
d[72] = 'Paul'
print d
95: 'Adam',
85: 'Lisa',
59: 'Bart'
}
d[72] = 'Paul'
print d
2015-12-16
sum = 0
x = 0
while True:
x = x + 1
if x%2 == 0:
continue
if x > 100:
break
sum = sum +x
print sum
x = 0
while True:
x = x + 1
if x%2 == 0:
continue
if x > 100:
break
sum = sum +x
print sum
2015-12-16
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:
print x * 10 + y
for y in [0,1,2,3,4,5,6,7,8,9]:
if x < y:
print x * 10 + y
2015-12-16
sum = 0
x = 1
n = 0
while True:
sum = sum + x
n=n+1
x=2**n
if n>20:
break
print sum
x = 1
n = 0
while True:
sum = sum + x
n=n+1
x=2**n
if n>20:
break
print sum
2015-12-16
print r'''"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.'''
这中格式就是你三个单引号中有什么就输出什么
2015-12-16
print 'hello, pyhon'
print 'hello,','pyhon'
print 'hello,','pyhon'
2015-12-15
score = 85
if score>=90:
print 'excellent'
elif score>=80:
print 'good'
elif score>=60:
print 'passed'
else:
print 'failed'
if score>=90:
print 'excellent'
elif score>=80:
print 'good'
elif score>=60:
print 'passed'
else:
print 'failed'
2015-12-15
t = ('a', 'b', ('A', 'B'))
print t
print t
2015-12-15