最新回答 / 终日未眠
sum = 0x = 1n = 1while True: sum=sum+x x=x*2 n=n+1 if n>20: breakprint sum这样也对
2018-12-24
已采纳回答 / 慕沐9167629
第一个for循环里将aliens定义为一个list,在第二个for循环里,你定义了alien遍历list(aliens)前3个元素,会得到:{'color':'blue','point':5,'speed':'slow'}{'color':'blue','point':5,'speed':'slow'}{'color':'blue','point':5,'speed':'slow'}每个元素都是dict然后你定义了这三个元素中,当key值color为blue时(alien['color'] == 'blu...
2018-12-24
双引号不转义也可以吧。
比如这样: 'Python was started in 1989 by "Guido".\nPython is free and easy to learn.'
比如这样: 'Python was started in 1989 by "Guido".\nPython is free and easy to learn.'
2018-12-24
L = []
for item in range(1,101):
L.append(item*item)
print sum(L)
for item in range(1,101):
L.append(item*item)
print sum(L)
2018-12-24
L = []
for item in range(1,100):
L.append(item*item)
print sum(L)
for item in range(1,100):
L.append(item*item)
print sum(L)
2018-12-24
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*10+y
for y in [0,1,2,3,4,5,6,7,8,9]:
if x<y:
print x*10+y
2018-12-24
sum = 0
x = 1
n = 1
while True:
sum+=x
n+=1
x*=2
if n>20:
break
print sum
x = 1
n = 1
while True:
sum+=x
n+=1
x*=2
if n>20:
break
print sum
2018-12-24