I have a loop, it should trigger on the first if, but it doesn't.
If I print the values
print("Books: {0} {1} {2} {3}".format(book['bookid'], allbooks['bookid'], book['Author'], allbooks['Author']))
I get: Books: 0001 0001 AJHartley AJHartley
I've tried:
if book['bookid'] in allbooks['bookid'] and book['Author'] in allbooks['Author']:
book_exists += 1
if book['bookid'] == allbooks['bookid'] and book['Author'] == allbooks['Author']:
book_exists += 1
The only way I can get a match is if I have
if "0001" in book['bookid'] and "AJHartley" in allbooks['Author']:
book_exists += 1
But I'd like to compare two dictionary key values.