Callum Anderson6,082 Points
Wording of question is confusing for me. JSON Strings in Flask Basics
Feeling a bit miffed as I'm not understanding and would like a second perspective! been enjoying this so far and would like to continue. Should be able to view the challenge to see the question and such on the top right.
import json def to_json():
Jennifer NordellTreehouse Teacher
Hi there, Callum Anderson ! Looks like you've got started pretty well. Your function definition is going to need a parameter to hold what we're passing in. In this case, it's asking you to convert it to a string. So you will need the
.dumps() method of
import json def to_json(py_dict): # accept a Python object return json.dumps(py_dict) # convert the Python object (dict) to a string and return it
Hope this helps!