diff options
-rw-r--r-- | loop.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -0,0 +1,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)
\ No newline at end of file |