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+y
for y in [ '0','1','2','3','4','5','6','7','8','9' ]:
if x < y:
print x+y
2016-01-12
s = 'Python was started in 1989 by "Guido".''\n''Python is free and easy to learn.'
print s
我习惯这么写,用单引号标示出每一个语句还能特别标识出换行符,很清晰,不会被一目十行看漏换行符
print s
我习惯这么写,用单引号标示出每一个语句还能特别标识出换行符,很清晰,不会被一目十行看漏换行符
2016-01-11
这个题确实是答案错了!
看了楼上的评论,确实是把u改成r就对了。哎!!!
# -*- coding: utf-8 -*-
print r'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
看了楼上的评论,确实是把u改成r就对了。哎!!!
# -*- coding: utf-8 -*-
print r'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2016-01-11
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print "None"
print L[0]
print L[1]
print L[2]
print "None"
2016-01-11
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print "None"
print L[0]
print L[1]
print L[2]
print "None"
2016-01-11
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[None]
print L[0]
print L[1]
print L[2]
print L[None]
2016-01-11
s = 'Python was started in 1989 by "Guido".\nPython is free and easy to learn.'
print s 这样就可以了,这里面没有补习区分的必要,放到jetbrains编译器上完全正确,给答案的太粗心
print s 这样就可以了,这里面没有补习区分的必要,放到jetbrains编译器上完全正确,给答案的太粗心
2016-01-11
sum = 0
x = 1
n = 1
while True:
sum+=x;
x*=2;
n+=1;
if n>20:
break;
print sum
x = 1
n = 1
while True:
sum+=x;
x*=2;
n+=1;
if n>20:
break;
print sum
2016-01-11
http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000老师的网站上的教程
2016-01-11
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
print 'Adam:'+str(d.get('Adam'))
print 'Lisa:'+str(d['Lisa'])
print 'Bart:'+str(d.get('Bart'))
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
print 'Adam:'+str(d.get('Adam'))
print 'Lisa:'+str(d['Lisa'])
print 'Bart:'+str(d.get('Bart'))
2016-01-10
def average(*args):
n=len(args)
if n==0:
return 0.0
else:
return float(sum(args))/n
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
n=len(args)
if n==0:
return 0.0
else:
return float(sum(args))/n
print average()
print average(1, 2)
print average(1, 2, 2, 3, 4)
2016-01-10