So I have been trying to play around with keys and values where I then figured out I want to do a sort of contais.
I am using different json values that contains numbers of:
{'60': {'databaseurl': 'hello/world', 'name': 'Apple'}}
{'104': {'databaseurl': 'hello/world', 'name': 'Orange'}, '65': {'databaseurl': 'hello/world', 'name': 'Banana'}}
{'104': {'databaseurl': 'hello/world', 'name': 'Orange'}, '65': {'databaseurl': 'hello/world', 'name': 'Banana'}}
{'104': {'databaseurl': 'hello/world', 'name': 'Orange'}, '65': {'databaseurl': 'hello/world', 'name': 'Banana'}}
{'46': {'databaseurl': 'hello/world', 'name': 'Nuts'}}
{'81': {'databaseurl': 'hello/world', 'name': 'Nuts'}, '46': {'databaseurl': 'hello/world', 'name': 'Nuts'}}
and as you can see there is value of key such as 60, 104, 65, 46 and 81.
My wish is to be able to print out only the 46 and 81 numbers
What I tried to do is:
for i in resp.json().values():
if i['numberssaved'] == 81 or 46:
print(i['numberssaved'])
but that just prints out all of these numbers (Which is at the beginning of this thread) which I dont want.
My output that I want is that it should only printout everyone that contains only number of 81 and 46!
What did I do wrong with the code that it doesn't get only numbers 46 and 81?
The differene between the suggestion answer is not the same because in this issue it contains key and values where I want to check if the keys contains the numbers then continue the script else just pass.