[EMAIL PROTECTED] wrote:
> Hi there. So I have a challenge in the Python book I am using (python
> programming for the absolute beginner) that tells me to improve a
> function, so that it can be called with a step value, and I havn't
> been able to find out yet what's meant by a step value, but i'll keep
> looking of course. I'd just be grateful if someone could illimunate
> this for me.
> 
> Thanks in advance.
> 

Trivial and redundant examples, but you get the point:

def doit(start, stop):
   for i in range(start, stop):
     print i

def doit_step(start, stop, step):
   for i in range(start, stop, step):
     print i

At work:

py> doit(2, 11)
2
3
4
5
6
7
8
9
10
py> doit_step(2, 11, 2)
2
4
6
8
10
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to