(已通过)正确答案:
print 'hello,python'
print 'hello,','python'
print 'hello,python'
print 'hello,','python'
2016-01-21
L = ['Adam', 'Lisa', 'Bart']
(L[0],L[2])=(L[2],L[0])
print L
(L[0],L[2])=(L[2],L[0])
print L
2016-01-21
sum = 0
x = 1
while x <= 100:
if x / 2 == 0:
sum = sum +x
elif
print x
print sum
x = 1
while x <= 100:
if x / 2 == 0:
sum = sum +x
elif
print x
print sum
2016-01-21
坑爹,dict.iterkeys(),dict.iteritems(),dict.itervalues()方法在python3中都不再支持
2016-01-21
sum = 0
x = 0
while True:
x += 1
if x > 100:
break
elif x%2 != 0:
sum += x
else:
continue
print sum
x = 0
while True:
x += 1
if x > 100:
break
elif x%2 != 0:
sum += x
else:
continue
print sum
2016-01-21
s='Python was started in 1989 by \"Guido\".\nPython is free and easy to learn.'
print s
print s
2016-01-21
for x in ['0','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+y
for y in ['0','1','2','3','4','5','6','7','8','9']:
if x < y :
print x+y
2016-01-21
sum = 0
x = 1
n = 1
while True:
sum += 2**(x-1)
x += 1
n += 1
if n > 20:
break
print sum
x = 1
n = 1
while True:
sum += 2**(x-1)
x += 1
n += 1
if n > 20:
break
print sum
2016-01-21
这样是最正确的,但是与答案不符提示错误
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'
2016-01-21