I have created the following code to create a leaderboard:
leaderboard_file = open("Leaderboard.txt", "r") details = [] for li