Anonymous user
Loops/N plus one half: Difference between revisions
→{{header|Python}}
Line 256:
=={{header|Python}}==
<python>
for i in xrange(1, 11):
if i == 10:
break
print
</python>
Note: this example uses the Python idiom of building a string as a list and joining the parts together (on an empty string) which is generally far more efficient than instantiating new strings at every step along the way. (Strings are immutable so each expression using "some string" + "some other string" is building new objects rather than appending to existing ones).
=={{header|Scheme}}==
|