Practical Programming, Third Edition: Use of "range(len(values))" un-Pythonic (p. 155)

The example on p. 155 shows the following:

values = [4, 10, 3, 8, -6]
for i in range(len(values)):
… print(i)

is un-Pythonic. The Pythonic way to do this:

for i, item in enumerate(values):
… print(i)

Also, later on this page the authors loop over a list and modify it in place while looping. This is often risky and I feel the reader should be warned about the perils.

Cheers!
boB Stepp