DEV Community 👩‍💻👨‍💻

VICTOR OMONDI
VICTOR OMONDI

Posted on

Convert to JSON in Python vs Javascript

Python:

import json

user = {
    "name": "Victor"
}

json_py = json.dumps(user)
Enter fullscreen mode Exit fullscreen mode

Javascript:

const user = {
    name: "Victor"
}

const jsonJs = JSON.stringify(user);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

12 APIs That You Will Love

Free and easy to use APIs for your next project, learning a new technology, or building a new feature.