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
l = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for ch in l:
a = ch[0]
b = ch[1]
c = ch[2]
s = 2*(a*b+a*c+b*c)
print(s)
for ch in l:
a = ch[0]
b = ch[1]
c = ch[2]
s = 2*(a*b+a*c+b*c)
print(s)
2020-12-17
L = ['Alice', 66, 'Bob', True, 'False', 100]
i = 1
for ch in L:
i = i+1
if i % 2 == 0:
continue
print(ch)
i = 1
for ch in L:
i = i+1
if i % 2 == 0:
continue
print(ch)
2020-12-16