You are viewing a single comment's thread from:

RE: Programming contest 4

in #contest6 years ago

Shorter solution in python:

for i in range(1, 1000, 2):
      print(i)

Explanation: range function can take 3 arguments:
[start], stop[, step]
So to print odd numbers starting from 1, you can just use a step size of 2 instead of skipping them later using if i % 2

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 54396.77
ETH 2275.61
USDT 1.00
SBD 2.31