{"user1": {"wallet": 45253, "bank": 4563}, "user2": {"wallet": 46212, "bank": 8462}, "user3": {"wallet": 96343, "bank": 6944}, "user4": {"wallet": 6946, "bank": 4593}, "user5": {"wallet": 4354, "bank": 13445}, "user6": {"wallet": 1134, "bank": 456364}}
I'm making a discord bot and i wanted to make leaderboard but i'm not able to sort this dictionary by the bank value, i tried sorted_data = {k: v for k, v in sorted(data.items(), reverse=True ,key=lambda item: item[1]["bank"])} but the value is just a string with the wallet and the bank