Updated for loop

Now works for both range() and list.