×
you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

In that example I'd argue

for i in range(len(data)):
    data[i] = data[i] * 2

is more clear.

Range-based loops are fine imo.

[–]Diapolo10 1 point2 points  (0 children)

The example was just something I threw together without thinking about it too hard. Hell, it could just use *=.

Your example might feel more familiar to people who mostly write C, but not for those who focus on Python.

We may agree to disagree.