Using “For”

--Originally published at My B10g

The For looping

The same as the while it will repeat the code bellow but instead of checking if something is real it checks if the parameters are still in the given range like…
  for i in 10:
        print (i)


this will print the numbers from 1 to 9

The benefit from using for to while is that while requires more CPU so to make a more efficient code its better to use for.