What is a more pythonic or efficient way of comparing 2 sets of variables and doing something if they are not equal?
for example, this works, but I feel like there is probably a better way than multiple if
statements?
#Var set A
a=1
b=5
c=6
d=10
e=15
#Var set B
aa=2
bb=5
cc=6
dd=10
ee=14
#comparison code
if a == aa:
#do something
if b == bb:
#do something
if c == cc:
#do something
if d == dd:
#do something
if e == ee:
#do something
My actual code will require about 50 if statements so I am looking for a more efficient method. Thanks!
EDIT
I left original code above as some people already answered, but they were not sure if #do something
was different or the same code (sorry for the confusion). #do something
is different. Below is more representative of what I am trying to accomplish.
#Var set A
a=1
b=5
c=6
d=10
e=15
#Var set B
aa=2
bb=5
cc=6
dd=10
ee=14
#comparison code
if a == aa:
a = 'match'
if b == bb:
b = 'match'
if c == cc:
c = 'match'
if d == dd:
d = 'match'
if e == ee:
e = 'match'