I wanna make simple condition to check whether element 'a' in A and element 'b' in B has a some characteristic.
the below code operates well, it looks dirty, so, I wanna make it simpler, or one-liner. are there any way to do that?
def check_direction(A, B):
for a in A:
for b in B:
if c_matrix.loc()[a][b]!="->":
return False
return True
Aucun commentaire:
Enregistrer un commentaire