All challenges
Multiple ChoiceHard 30s

json Custom Encoder

Choose the best answer for: JSON serialization of custom objects
Options
  1. 1Define a custom encoder class inheriting JSONEncoder
  2. 2Use str() on the object, since json.dumps accepts it directly
  3. 3Custom objects are always serializable, Python introspects them
  4. 4JSON can serialize any Python object without a custom encoder

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle