Python - Using while loop to count value

Introduction

The following code counts from the value of a up to, but not including, b.

Demo

a=0; b=10 
while a < b:              # One way to code counter loops 
    print(a, end=' ') 
    a += 1                # Or, a = a + 1
#   w ww .j ava2  s  .  c  om

Result

Related Topic