Im new to Python and am having issues with lists, elements,etc. I have this code:
order_payment = Api.which_api('order_payments', 'None', '26', 'None')
# now that we have info from order_payment, obtain the rest of the vars we need
order_id = order_payment['order_id']
order_payment = Api.which_api('order_payments', 'None', '26', 'None')
orders = Api.which_api('orders', 'None', order_id, 'items')
# your loop
for orders in orders['items']:
oid = orders['order_id']
item = orders['item_name']
print(item)
sub = 'Download'
print (s for s in item if sub in s)
When I do print(item) I get this returned: Norton Antivirus 2014 - Download - 1 User / 1 PC - 1 Year Subscription
I want to check this variable to see if it has Download in it(like this one does) I looked on here and found the code Im trying(sub = 'Download') but that is not working. Basically Im trying to set up a if condition. If this element 'item_name' has 'Download' in it do this. How do i check the vairable for this