A
A
anton_zaboev2021-12-09 21:38:43
Python
anton_zaboev, 2021-12-09 21:38:43

How to properly output json file?

Good evening! How to output json file in console? Here is a link to the code
. It should be displayed like this, 61b24c93a91c7682859740.jpeg
but it is output like this 61b24cf9125bb178712904.jpeg
. Please tell me how can I output it in the right format

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Drill, 2021-12-10
@anton_zaboev

import json

with open('questions.json') as file:
    file_parse = json.load(file)
    for key in file_parse:
        print(f'{key:<10}', *file_parse[key].keys())

Transport  100 200 300
Animals    100 200 300
Meal       100 200 300

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question