Q:

Best practice when iterating through string Python?

When you're iterating through a string with a for each loop, is it better to convert the string to a list and then loop through it? The reason I'm asking is because strings are immutable, so I'm not sure if it becomes inefficient in some way?
So, is
a = list("hello")
for i in a:
    pass

better than
a = "hello"
for i in a:
    pass

Thanks for the help. 

A:

As has been noted, the idiomatic way is to simply iterate through the string.  In fact the statement
a = list("hello")

needs to iterate through the string in order to create the list.
That said, if you are to be iterating through the same string, many times, then (after paying the cost of converting to a list) iteration through a list is faster
# string
$ python -m timeit -s "x='a'*10000" "for i in x: i"
10000 loops, best of 3: 137 usec per loop

# raw list
python -m timeit -s "x=list('a'*10000)" "for i in x: i"
10000 loops, best of 3: 113 usec per loop

