Skip to content
Advertisement

How to create a JSON file from another JSON file based on IF condition! Python3

I have a json file like this:

JavaScript

I need to re-create another JSON file based on this information. For example:

IF shift == NIGHT:

shiftHourStart = 22:00:00

shiftHourEnd = 06:00:00

So output should be like this:

JavaScript

Advertisement

Answer

you can use dict.update

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement