n=100
x=0
odd=0
while x<n:
if x%2:
odd += x
x += 1
print odd
x=0
odd=0
while x<n:
if x%2:
odd += x
x += 1
print odd
2015-07-16
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-15
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
print "Adam: 95"
print "Lisa: 85"
print "Bart: 59"
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
print "Adam: 95"
print "Lisa: 85"
print "Bart: 59"
2015-07-15
for x in range(1,9):
for y in range(0,10):
if x<y:
print x*10+y
for y in range(0,10):
if x<y:
print x*10+y
2015-07-15
L = []
n = 1
while n <= 100:
L.append(n*n)
n = n + 1
print sum(L)
n = 1
while n <= 100:
L.append(n*n)
n = n + 1
print sum(L)
2015-07-15
>>> print 2.5+10/4
4.5
>>> print 2.5+10/4.0
5.0
4.5
>>> print 2.5+10/4.0
5.0
2015-07-15
#-*-coding:utf-8-*-
print u'''静夜思
床前明月光,
……
低头思故乡。'''
print u'''静夜思
床前明月光,
……
低头思故乡。'''
2015-07-15