Python
>>> range(1,11) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> map (lambda x: x+1, range(10)) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> [n + 1 for n in range(10)] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Ruby
irb(main):001:0> (1..10).to_a [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] irb(main):002:0> [*1..10] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]