In Python, the enumerate function allows you to iterate over a sequence of (index, value) pairs. For example:
>>> numbers = [\"zero\", \"one\", \"tw
List list = { "foo", "bar", "foobar"}; int i = 0; for (String str : list){ System.out.println(i++ + str ); }