sum(int(n[2:]) for n in arr)
.sum(int(re.sub(r'\D', '', n)) for n in arr)
. TEXT_WORDS = []
index = 0
for word in TEXT.split():
index = TEXT.index(word, index)
TEXT_WORDS.append((word, index))
index += len(word)
mass
передавайте mass.copy()
. for i, (k, v) in enumerate(sorted(top_list.items(), key=lambda n: n[1], reverse=True), 1):
print(f'{i}) {k} - {v}')
sortedData = sorted(zip(numbers, users), key=lambda n: int(n[0]), reverse=True)
print('\n'.join(f'{i}. {n[0]} {n[1]}' for i, n in enumerate(sortedData, 1)))
print('\n'.join(f'{i}. {n}' for i, n in enumerate(sorted(numbers, key=int, reverse=True), 1)))