-1
Я в настоящее время имею этот код, написанный объявить 10 переменные в Python:Объявление нескольких переменных в цикле питон
oneScore = textFont.render('1. ' + str(sortedList[0][0]) + ' ' + str(sortedList[0][1]), True, white)
twoScore = textFont.render('2. ' + str(sortedList[1][0]) + ' ' + str(sortedList[1][1]), True, white)
threeScore = textFont.render('3. ' + str(sortedList[2][0]) + ' ' + str(sortedList[2][1]), True, white)
fourScore = textFont.render('4. ' + str(sortedList[3][0]) + ' ' + str(sortedList[3][1]), True, white)
fiveScore = textFont.render('5. ' + str(sortedList[4][0]) + ' ' + str(sortedList[4][1]), True, white)
sixScore = textFont.render('6. ' + str(sortedList[5][0]) + ' ' + str(sortedList[5][1]), True, white)
sevenScore = textFont.render('7. ' + str(sortedList[6][0]) + ' ' + str(sortedList[6][1]), True, white)
eightScore = textFont.render('8. ' + str(sortedList[7][0]) + ' ' + str(sortedList[7][1]), True, white)
nineScore = textFont.render('9. ' + str(sortedList[8][0]) + ' ' + str(sortedList[8][1]), True, white)
tenScore = textFont.render('10. ' + str(sortedList[9][0]) + ' ' + str(sortedList[9][1]), True, white)
есть более эффективный способ сделать это?
Должны ли они быть в виде переменных? Не могли бы вы поместить их в словарь? EDIT: или любой другой тип последовательности –
Это моя домашняя страница, но * Python не имеет объявлений переменных *. –