G
Here's a little example, of course, without knowing what you need and not seeing your attempts, it's hard to judge what you're not:import sqlite3
con = sqlite3.connect(":memory:")
cur = con.cursor()
cur.executescript("create table table1(human,money);")
cur.execute("insert into table1(human, money) values ('Леонид Михельсон', 24000 );")
cur.execute("insert into table1(human, money) values ('Владимир Лисин', 21300 );")
cur.execute("insert into table1(human, money) values ('Вагит Алекперов', 20700 );")
cur.execute("insert into table1(human, money) values ('Алексей Мордашов и семья', 20500 );")
cur.execute("insert into table1(human, money) values ('Геннадий Тимченко', 20100 );")
cur.execute("insert into table1(human, money) values ('Владимир Потанин', 18100 );")
cur.execute("insert into table1(human, money) values ('Михаил Фридман', 15000 );")
cur.execute("insert into table1(human, money) values ('Андрей Мельниченко', 13800 );")
cur.execute("insert into table1(human, money) values ('Алишер Усманов', 12600)")
cur.execute("insert into table1(human, money) values ('Роман Абрамович', 12400 );")
cur.execute("insert into table1(human, money) values ('Виктор Вексельберг', 11500 );")
cur.execute("insert into table1(human, money) values ('Михаил Прохоров', 9800 );")
cur.execute("insert into table1(human, money) values ('Герман Хан', 9700 );")
cur.execute("insert into table1(human, money) values ('Виктор Рашников', 8900 );")
cur.execute("insert into table1(human, money) values ('Леонид Федун и семья', 8700 );")
делаем из результата массив
rows = [row for row in con.execute('SELECT * FROM table1 ORDER BY money DESC LIMIT 10;')]
выводим
print(rows)
con.close()
The conclusion will be:[('Леонид Михельсон', 24000), ('Владимир Лисин', 21300), ('Вагит Алекперов', 20700), ('Алексей Мордашов и семья', 20500), ('Геннадий Тимченко', 20100), ('Владимир Потанин', 18100), ('Михаил Фридман', 15000), ('Андрей Мельниченко', 13800), ('Алишер Усманов', 12600), ('Роман Абрамович', 12400)]
still.[first, num2, num3, num4, num5, num6, num7, num8, num9, last ] = rows
print(first)
print(last)
The conclusion will be:('Леонид Михельсон', 24000)
('Роман Абрамович', 12400)