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:
if x*10+y>10:
print x*10+y
这才是正确的吧
for y in [0,1,2,3,4,5,6,7,8,9 ]:
if x<y:
if x*10+y>10:
print x*10+y
这才是正确的吧
2019-01-08
print [int(x+y+x) for x in "123456789" for y in "0123456789"]
2019-01-08
n=zip(range(1,5),['Adam','Lisa','Bart','Paul'])
for index,name in n:
print index,'-',name
for index,name in n:
print index,'-',name
L = range(1, 101)
print L[:10]
print L[2::3]
print L[4:50:5]
print L[0:50][4::5]
print L[:10]
print L[2::3]
print L[4:50:5]
print L[0:50][4::5]
2019-01-08
sum = 0
x = 0
while True:
sum = sum + 2**x
x = x + 1
if x >= 20:
break
print sum
x = 0
while True:
sum = sum + 2**x
x = x + 1
if x >= 20:
break
print sum
2019-01-08
不要叫"u",加了就出错。
正确代码:
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
正确代码:
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2019-01-07