Ask coding questions

← Back to all posts
Why is this error happening and how do I fix it?
h
VulcanWM (2758)

In this code: https://replit.com/@OvalEyes/OvalEyes#functions.py
it shows an error when I do the getstockprice function. I know it’s something related to json but I’ve used that code before a few times and it was working fine?
Why is that happening and how do I fix it?

Answered by themining72 (49) [earned 5 cycles]
View Answer
Comments
hotnewtop
themining72 (49)

You have an extra comma at the end of the JSON.

Line 21, stocks.json
{"Name": "New Zealand", "Code": "NZ", "Amount": 100000, "Increase": 0},

to:

Line 21, stocks.json
{"Name": "New Zealand", "Code": "NZ", "Amount": 100000, "Increase": 0}

I don't know why something so minor would be an error but I guess it is. lol