Multiple distinct objects: Difference between revisions

→‎{{header|Python}}: Link to other example
(→‎{{header|Python}}: Link to other example)
Line 36:
which is incorrect since <code>Foo()</code> is only evaluated once. A common correct version is:
<code python>[Foo() for i in xrange(n)]</code>
which evaluates <tt>Foo()</tt> <var>n</var> times and collects each result in a list. This last form is also discussed [[Two-dimensional_array_(runtime)#Python|here]], on the correct construction of a two dimensional array.
Anonymous user