users_db = [
{'id': '2313', 'coins': 50},
{'id': '8213', 'coins': 20},
{'id': '9989', 'coins': 0},
{'id': '4654', 'coins': 1},
{'id': '7897', 'coins': 3},
{'id': '9898', 'coins': 60}
]
users_db.sort(key = lambda user: user['coins'])
print(users_db)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter