# l.append([f'{i.track.popularity:03d}')+" | "+trackname(i.track)+" by "+primary_artist(i.track)])
l.sort(key=operator.itemgetter('popularity'))
forrank,lineinenumerate(l):
print(rank,line)
# We'll have to get this item's current location, annoyingly, each time. You'd think we could just use the URIs but maybe the same song can be on a playlist multiple times? To avoid repeated API calls, we'll reorder an in-memory local list as well and use that to query positions