Ask coding questions

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

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 [earned 5 cycles]
View Answer
Voters
VulcanWM
Comments
hotnewtop
themining72

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

VulcanWM

Ah it works ty! @themining72