R
R
Ruslan Mordovanech2021-12-04 20:15:47
Python
Ruslan Mordovanech, 2021-12-04 20:15:47

I want to ask, did I write Json reading and output well?

with open('datafile.json', 'r', encoding='utf-8') as f:
    file_content = f.read()
    data1 = json.loads(file_content)
d = 'Товтин Ярослав'
for i in data1:
   if d.upper() in i['involved'].upper():
     print(i['date'], i['judge'], i['forma'], i['number'], i['involved'], i['description'], sep='\n')

Everything works as I planned, but I want to clarify everything is well spelled out? Are there bugs that I don't know about?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kokapuk, 2021-12-04
@kokapuk

Yes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question