This language bar is your friend. Select your favorite languages!

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

#Edit dateEdit SummaryEditor
👁 Δ 63 2017-07-30, 16:13 [D] Array name is items programming-idioms.org
👁 Δ 62 2017-07-27, 23:58 New D implementation by user [Bzzzzzzz] Bzzzzzzz
👁 Δ 61 2017-06-07, 15:45 New Scheme implementation by user [Dodopod] Dodopod
👁 Δ 60 2017-04-17, 18:51 [Ruby] Variable name is x programming-idioms.org
👁 Δ 59 2017-04-17, 18:51 [Ruby] One-liner is fine. Three-liner already exists in other impl. programming-idioms.org
👁 Δ 58 2017-04-15, 18:11 [Ruby] original code was too complicated and un-ruby like hakunin
👁 Δ 57 2017-01-25, 09:35 [Cpp] +DocURL programming-idioms.org
👁 Δ 56 2016-11-27, 22:20 [Pascal] Variable names programming-idioms.org
👁 Δ 55 2016-11-27, 22:19 [Pascal] Variable names programming-idioms.org
👁 Δ 54 2016-10-23, 21:16 Restored version 5 programming-idioms.org
👁 Δ 53 2016-10-23, 08:26 dRJC6hisOF Delia
👁 Δ 52 2016-10-18, 21:26 +keywords programming-idioms.org
👁 Δ 51 2016-06-05, 16:53 [Go] Better comment programming-idioms.org
👁 Δ 50 2016-06-05, 15:06 Linked to idiom #134 [Create a new list] programming-idioms.org
👁 Δ 49 2016-04-18, 20:14 [Ruby] each_with_index iterates over index and value at the same time. steenslag
👁 Δ 48 2016-02-18, 16:57 [Haskell] Shorter, more idiomatic, less duplication
👁 Δ 47 2016-02-17, 11:50 [Haskell] Shorter, more idiomatic, less duplication
👁 Δ 46 2016-02-16, 21:21 New Scala implementation by user [meshelton]
👁 Δ 45 2016-02-16, 16:46 [Ada] Use variable 'x'
👁 Δ 44 2016-02-16, 15:24 New Ada implementation by user [Smaehtin]
👁 Δ 43 2016-02-16, 15:01 New Lua implementation by user [jparoz]
👁 Δ 42 2016-02-05, 10:54 [Cpp] items is supposed to be given. We focus on the code of the loop.
👁 Δ 41 2016-02-05, 10:53 [Pascal] Comment emphasize
👁 Δ 40 2016-02-05, 10:51 [Csharp] items is supposed to be given. We focus on the code of the loop.
👁 Δ 39 2016-02-05, 10:51 [C] Comment emphasize
👁 Δ 38 2016-02-05, 10:49 Admin deletes impl 396
👁 Δ 37 2016-02-05, 08:21 New Csharp implementation by user [dhe]
👁 Δ 36 2016-02-03, 16:45 [JS] Alternative impl -> created new impl 1267
👁 Δ 35 2016-02-03, 16:43 New JS implementation by user [programming-idioms.org]
👁 Δ 34 2016-01-19, 09:59 New Cpp implementation by user [mikee]
👁 Δ 33 2015-12-30, 17:02 [Go] +DocURL, +DemoURL
👁 Δ 32 2015-11-30, 12:37
👁 Δ 31 2015-10-29, 14:05
👁 Δ 30 2015-10-27, 03:02
👁 Δ 29 2015-09-04, 11:38
👁 Δ 28 2015-09-03, 13:13
👁 Δ 27 2015-09-03, 13:08
👁 Δ 26 2015-09-03, 13:08
👁 Δ 25 2015-09-03, 12:39
👁 Δ 24 2015-08-22, 22:59
👁 Δ 23 2015-08-22, 22:58
👁 Δ 22 2015-08-22, 22:56
👁 Δ 21 2015-08-22, 09:06
👁 Δ 20 2015-08-22, 09:05
👁 Δ 19 2015-08-21, 08:40
👁 Δ 18 2015-08-21, 07:10
👁 Δ 17 2015-08-21, 07:05
👁 Δ 16 2015-08-20, 15:32
👁 Δ 15 2015-08-20, 15:31
👁 Δ 14 2015-08-20, 07:08
👁 Δ 13 2015-08-18, 21:00
👁 Δ 12 2015-08-13, 03:50
👁 Δ 11 2015-08-13, 03:50
👁 Δ 10 2015-08-13, 03:50
👁 Δ 9 2015-08-13, 03:49
👁 Δ 8 2015-08-05, 08:25
👁 Δ 7 2015-08-05, 08:22
👁 Δ 6 2015-08-04, 16:38
👁 Δ 5 2015-08-04, 16:38
👁 Δ 4 2015-08-04, 16:37
👁 Δ 3 2015-08-01, 16:46
👁 Δ 2 2015-07-31, 19:16
1 2015-05-06, 21:04