QuestionQ22Verified/File Processing and Communicating with a Program’s EnvironmentCopy linkReport a problemAsk AstroTutorSave questionWhich of the following statements about the json.dumps() function are true?Choose twoAIt returns a JSON string.BIt returns a Python entity.CIt takes a JSON string as its argument.DIt takes Python data as its argument.Show AnswerAnswerExplanationThe Python json module's dumps() function serializes a Python object (such as a dict or list) into a JSON-formatted string. It accepts Python data as its input argument and returns that data encoded as a JSON string — it does not read a JSON string or return a native Python object (that behavior belongs to json.loads(), which parses a JSON string into a Python object).Learn morejson — JSON encoder and decoder — Python documentationShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion