JSON

Report a typo

JSON is a format for storing data. Below is an example of a simple JSON representation for a person. Let's practice a bit! Write a program that prints this exact representation.

{
    "firstName": "John",
    "lastName": "Smith",
    "age": 35,
    "phoneNumbers": [
        {
            "type": "mobile",
            "number": "123 567-7890"
        }
    ]
}

Remember, you only need to print the text, pay attention to the indentation.

Sample Input 1:

Sample Output 1:

{
    "firstName": "John",
    "lastName": "Smith",
    "age": 35,
    "phoneNumbers": [
        {
            "type": "mobile",
            "number": "123 567-7890"
        }
    ]
}
Write a program in Kotlin
fun main() {
// put your code here
}
___

Create a free account to access the full topic