L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
S=[89, 72, 88, 79, 99]
Ss=[89, 72, 88, 79, 99]
def getnames(name):
return Ss.index(name)
S.sort(reverse=True);
for sa in S:
print(sa)
print(L[getnames(sa)])
print(r'''
''')
S=[89, 72, 88, 79, 99]
Ss=[89, 72, 88, 79, 99]
def getnames(name):
return Ss.index(name)
S.sort(reverse=True);
for sa in S:
print(sa)
print(L[getnames(sa)])
print(r'''
''')
2021-05-31
a = 'python'
print('hello,'+( a or 'world'))
b = ''
print('hello,'+(b or 'world'))
print('hello,'+( a or 'world'))
b = ''
print('hello,'+(b or 'world'))
2021-05-31
L = [95.5, 85, 59, 66, 72]
L.sort(reverse=True)
for i in range(3):
print(L[i])
L.sort(reverse=True)
for i in range(3):
print(L[i])
2021-05-29
c = '{0},{1}'
C=c.format('Life is short', 'you need Python')
print(C)
C=c.format('Life is short', 'you need Python')
print(C)
2021-05-27
已采纳回答 / 慕圣6516049
index 是来表示你的数组位置的,你需要一个一个来判断奇偶,所以需要判断每一个位置的,index从0开始,意味着从第一个数开始判断。这是我的code:def sub_sum(l): n = 0 odd = [] even = [] for num in l: if n % 2 == 0: odd.append(num) else: even.append(num) n += 1; sumo...
2021-05-26
已采纳回答 / 慕码人0617
布尔值是逻辑判断时用的and:且的关系,a and b,及a和b的都为真时,才为真or:或的关系,a or b,只要有一个为真就返回真,都假才为假not:相当于取反, not a,若a为真,则 not a就是假,反之亦然
2021-05-26