In this post, we will see how to resolve How to remove json element with empty quotes?
python3code below I read all the
jsonthen loop through the
json. If I only search for the
id is not Nonethat element and the null value are removed. However when I add the
orstatement to remove the
id is not ""the entire file is printed with neither of the
idin the or statement removed. Being new to
pythonI am not sure what I am doing wrong. Thank you :).
If the value is None, then the
is not ""part will be true.
If the value is an empty string, then the
is not Nonepart will be true.
And if the value is anything else, then both parts will be true.
As @Pranav commented, you want to use
If you have better answer, please add a comment about this, thank you!