Q:

Python function argument not taking expected if else statement result

I am using the function argument in Python, and expecting the output based on the argument.
Code is as below:
DATA1 = ''
DATA2 = ''
item_select = 'D970'

def Display_DATA1(FALT_ARRAY):
   if(FALT_ARRAY == DATA1):
      request = '22 D9 70'
      print '1st' +' '+ request
   elif(FALT_ARRAY == DATA2):
      request = '22 D9 71'
      print '2nd' +' '+ request

if (item_select == 'D970'):
    Display_DATA1(DATA1);
elif(item_select == 'D971'):
    Display_DATA1(DATA2);

Expecting output as:
if:item_select = 'D970'

print '1st 22 D9 70
if:item_select = 'D971'

print '1st 22 D9 71
Now I am getting value for item_select = 'D971' as '1st 22 D9 70 which is not correct.
Let me know, what exactly do i need to change in code. Is any alternative way to write code for argument.

A:

your DATA1 and DATA2 are identical. Set like this it will work
DATA1 = '1'
DATA2 = '2'

