Dictionary error

2014-11-25 Thread Thuruv V
Please Clarify the 'TypeError: zip argument #1 must support iteration'


import openpyxl

book = openpyxl.load_workbook('c:/users/c_thv/desktop/tax.xlsx')
sheet = book.get_sheet_by_name('Thilip')
cell = sheet.cell(row=2,column = 4)
i = 2
x = []
y = []while i < 10:
   keys = sheet.cell(row=i,column = 4)
   values = sheet.cell(row = i,column = 5)
   x.append(keys.value)
   y.append(values.value)
   i +=1
   mydict = dict(zip(keys,values)print mydict
-- 
https://mail.python.org/mailman/listinfo/python-list


Why For Loop Skips the Last element?

2015-01-01 Thread Thuruv V
Hi all,

Here's the list. .

inlist = ["Fossil Women's Natalie Stainless Steel Watch Brown (JR1385)",
'Balmer Swiss Made Veyron Mens Watch: Black Band/ Black Dial (62625241)',
'Fortune NYC Ladies Quilted Dial Watch: Brown',
'Jeanne Collection w/ Swarovski Elements Watch: Dark Purple Band
(62623659)',
'Swiss Legend Commander Chronograph: Watch Orange/Black (SL-10067-01-ORS)',
'Debussy Ladies Watch: Brown/Gray/Silver 14070 - 62625292',
'#2 Swiss Legend Commander Chronograph: Green (SL-10067-BB-017)',
'Auguste Jaccard 3 Timezone Watch: Black Band/ Gray & Black Dial (62625184)'
]

My code :
i = 0
while i <= len(inlist):
if 'watch' in str(inlist[i]).lower() or 'watches' in
str(inlist[i]).lower():
if 'women' in str(inlist[i]).lower() or 'female' in
str(inlist[i]).lower() or 'ladies' in str(inlist[i]).lower():
print 'FEMale Watch', inlist.index(i),str(i)
elif 'men' in str(inlist[i]).lower() or 'male' in
str(inlist[i]).lower() or 'chronograph' in str(inlist[i]).lower():
print 'Male Watch',inlist.index(i),str(i)
i = next(inlist)

When on executing python skips the last element('Auguste Jaccard 3 Timezone
Watch: Black Band/ Gray & Black Dial (62625184)') in the list.

But when accessing through 'print inlist[0]' is possible,i.e it shows the
e;lement. but the list skips it. .
Please enlighten me. .
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list