- Code: Select all
`def product_lst(lst):`

len_items=lst[0]

for item in lst:

if item in lst==int is False:

return "Sorry, all items in input must be integers"

elif len_items>1000:

return "Sorry, please limit input to 1000 or fewer numbers"

else:

for item in range(lst[1], len_items):

product=1

lst.remove(item)

for item in range(lst[1], len_items):

product=product*item

return product

print product_lst([4,5,2,2,3])

Should return [12, 30, 30, 20]