仔细研究了一下才算明白这节课的任务要求,就是将这种 '\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.' 格式,改成r'''...'''格式
2014-12-17
score = 85
if score >= 90:
print 'excellent'
elif score >= 80 and score < 90:
print 'good'
elif score >= 60 and score < 80:
print 'passed'
else:
print 'failed'
if score >= 90:
print 'excellent'
elif score >= 80 and score < 90:
print 'good'
elif score >= 60 and score < 80:
print 'passed'
else:
print 'failed'
2014-12-16
for x in range(0,10):
for y in range(0,10):
if x>0 and x < y:
print x*10+y
for y in range(0,10):
if x>0 and x < y:
print x*10+y
2014-12-16
正确的代码应该是:
score = 85
if score >= 90:
print 'excellent'
elif score >=80 and score <90:
print 'good'
elif score >=60 and score<80:
print 'passed'
else:
print 'failed'
score = 85
if score >= 90:
print 'excellent'
elif score >=80 and score <90:
print 'good'
elif score >=60 and score<80:
print 'passed'
else:
print 'failed'
2014-12-15
x1 = 1
d = 3
n = 100
x100 = x1 + d * (n-1)
s = (x1 + x100) * n / 2
print s
还没到函数呢,你们放这么早干嘛?
d = 3
n = 100
x100 = x1 + d * (n-1)
s = (x1 + x100) * n / 2
print s
还没到函数呢,你们放这么早干嘛?
2014-12-15