Why does it say that the username is the error when you put in your username?
I’m trying to make it so if you put in a username it would make a new line in the json file with the username and how much there is in their wallet. It keeps saying that the username is the error so i don’t know what’s wrong. Thanks in advance!
The error is in line 17. Since 'username' isn't a dictionary you can't use the key 'wallet'.
@MisledWater79 Create 2 lists, one with users, one with wallets. Then append the user and wallet value to the list on a login. When calling it get the index of the user and then call the wallet value based on that index.
usname = input('What is your username?') user = ['hi'] wallet =  wallval = wallet[user.index(usname)]
@robowolf So I tried that and it didn't work but I found another way and if you look at the code now if you type in a username it puts it in the file but if you type in the same name it will just add it again. I believe its something to do with the if statement but I don't know how to fix it.