a = [7, 7, 6, 6, 6, 6, 5, 3, 2, 1, 1]
print(a)
a_set = list(sorted(set(a), reverse=True))
print(a_set)
b = []
for i in a:
b.append(a_set.index(i) + 1)
print(b)
欢迎分享,转载请注明来源:内存溢出
a = [7, 7, 6, 6, 6, 6, 5, 3, 2, 1, 1]
print(a)
a_set = list(sorted(set(a), reverse=True))
print(a_set)
b = []
for i in a:
b.append(a_set.index(i) + 1)
print(b)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)