tags:

views:

179

answers:

2
for s in stocks_list:
    print s

how do I know what "position" s is in? So that I can do stocks_list[4] in the future?

+4  A: 
for index, s in enumerate(stocks_list):
    print index, s
nosklo
A: 

How do I make a list without 0 being a starting number? I would like to start with number 1.

I tried this: enumerate(sequence[, start=0])

but it send me error because of = in brackets

q124
(1) Ask your own question, don't hijack somebody else's. (2) The error was having the brackets ... the brackets are used in the documentation of Python and many other languages to denote that whatever is in brackets is optional. Read `http://docs.python.org/tutorial/controlflow.html#more-on-defining-functions`. You need `enumerate(sequence, 1)` or (clearer) `enumerate(sequence, start=1)`
John Machin