I need to form the if else condition in my code. I am comparing two list with each other and print if there is any different item in each list or there isn't any. My code is below.
title_check = [[y for y in xml_title_list if y not in json_title_list], [y for y in json_title_list if y not in xml_title_list]]
if len(title_check [0]):
print("Type which are unmatched in XML are ", title_check [0])
if len(title_check [1]):
print("Type which are unmatched in JSON are ", type_check[1])
else:
print("No Unmatched type found")
I want to combine both if conditions and want to run it every time. if they don't execute i want else then. Right now it is only taking else condition for second if condition. Can someone help me? Thanks in advance