Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def scoreboard(PLAYER, SCORE):
  2.     with open('score.csv', 'r+',) as file:
  3.         scoreObject = csv.reader(file)
  4.         scoresPerPlayer = []
  5.        
  6.         for row in scoreObject:
  7.             scoresPerPlayer.append(row)
  8.        
  9.         for item in scoresPerPlayer:
  10.             if item[0] == PLAYER:
  11.                 item.append(SCORE)
  12.                
  13.         scoreObject.writerows(scoresPerPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement