Loops/For with a specified step: Difference between revisions

m (Added Sidef language)
Line 876:
print("%d, " % i, end="")
print("who do we appreciate?")</lang>
One liner:
<lang python>
print("%s, who do we appreciate"%(", ".join(map(str,range(2,9,2)))))
</lang>
Output
<pre>2, 4, 6, 8, who do we appreciate?</pre>
Anonymous user