Я упорядочиваю список предметов, которые я заменяю новыми, но, изменяя буквы на эквивалентное число и затем упорядочивая его, он сокращает порядок и делает его по частям.
for (i) in range(len(unico)):
if unico[i] == 'A':
unico[i] = '14'
elif unico[i] == 'D':
unico[i] = '10'
elif unico[i] == 'J':
unico[i] = '11'
elif unico[i] == 'Q':
unico[i] = '12'
elif unico[i] == 'K':
unico[i] = '13'
for (i) in range(len(unico2)):
if unico2[i] == 'A':
unico2[i] = '14'
elif unico2[i] == 'D':
unico2[i] = '10'
elif unico2[i] == 'J':
unico2[i] = '11'
elif unico2[i] == 'Q':
unico2[i] = '12'
elif unico2[i] == 'K':
unico2[i] = '13'
repetido, repetido2, unico, unico2 =
sorted(repetido, reverse=True), sorted(repetido2, reverse=True),
sorted(unico, reverse=True), sorted(unico2, reverse=True)
print (unico,unico2)
Я ожидал этого вывода:
['14', '13', '10','8','4','3'] ['14', '13', '12', '10', '7', '6', '5']
.. но вот что я получаю:
['8', '4', '3', '14', '13', '10'] ['7', '6', '5', '14', '13', '12', '10']