最新回答 / weixin_慕哥9339917
朋友,你这下边的条件是在判定奇数的基础上进行的,continue之后后边的就不执行了,把>1000的缩进调一下,让他们并列一个等级,其实你可以直接num+2,就不用判定了
2020-12-27
L = [95.5, 85, 59, 66, 72]
n=len(L)
j=0
for i in range(n):
for j in range(0,n-j-1):
if L[j]<L[j+1]:
L[j], L[j+1] = L[j+1], L[j]
for count in range(n):
if (count<3):
print(L[count])
else:
break
n=len(L)
j=0
for i in range(n):
for j in range(0,n-j-1):
if L[j]<L[j+1]:
L[j], L[j+1] = L[j+1], L[j]
for count in range(n):
if (count<3):
print(L[count])
else:
break
2020-12-24
template = 'Life is {a},you need {b}。'
a1='short'
bp='Python'
result=template.format(a=a1,b=bp)
print(result);
template = 'Life {}。'
result=template.format('is short, you need Python')
print(result)
a1='short'
bp='Python'
result=template.format(a=a1,b=bp)
print(result);
template = 'Life {}。'
result=template.format('is short, you need Python')
print(result)
2020-12-23
a=3.1415926
b='Learn Python in imooc.'
c=100
d=0b1101
print(type(a))
print(type(b))
print(type(c))
print(type(d))
b='Learn Python in imooc.'
c=100
d=0b1101
print(type(a))
print(type(b))
print(type(c))
print(type(d))
2020-12-21
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
Whether it's nobler in the mind to suffer.''')
2020-12-20