Home > OS >  Numbering loop python
Numbering loop python

Time:10-21

Please I'm trying to number this loop:

TopList = {'1350180828': 3, '1670937087': 2, '0743180828': 1, '9864937087': 8}

meg = "Top Referral List\n"
sort = sorted(TopList.items(), key=lambda x: x[1], reverse=True)

for info in sort:
    num = 1
    userlink = f'<a href="tg://user?id={info[0]}">{info[0]}</a>'
    meg  = f"\n{num} {userlink} -            
  • Related