0

why it dosnt print the result

as you can see in the error comment the file is written https://code.sololearn.com/cAFklhLStzl9/?ref=app https://code.sololearn.com/cAFklhLStzl9/?ref=app

4th Jan 2019, 6:41 AM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar
4 Answers
+ 2
use this res=json.loads(data) since data is a variable you don't have to open it.
4th Jan 2019, 7:03 AM
Mayank Dhillon
Mayank Dhillon - avatar
+ 1
Json.load is used to read json from a file while json.loads is to used to read json from a string, and in your case since you have stored the json data as a string in data variable hence you have to use json.loads
4th Jan 2019, 8:17 AM
Mayank Dhillon
Mayank Dhillon - avatar
0
thanks my friend are you can tell me about the difference between load &loads
4th Jan 2019, 8:00 AM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar
0
thanks👍
4th Jan 2019, 9:38 AM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar