summaryrefslogtreecommitdiffstats
path: root/loop.py
blob: d267af04c2161c0e5457544f634184b28085ebaa (plain)
1
2
3
4
5
6
7
8
i = 0;
while i != 10:
    print(i+1)
    i = i + 1  # there's no increment in Python

# for loop only works on collection, however you can use range() to implent numeric c-like loop
for j in range(10):
    print(j+1)