[Idle-dev] double result ...

Tadey tayiper at volja.net
Sun Nov 16 01:26:40 EST 2003


Hello, I was just trying some different combinations, and noticed, that in sequence of commands:

>>> a=7
>>> b=9
>>> c=8
>>> for i in range(a,b,c):
>>>    print i
...
...
7


... gives value a, becuse it is the first value in the row, and because a, b, c are no "logical sequence" for computer (it doesn't support alphabet) !!




>>> a=4
>>> b=6
>>> c=8
>>> for d in range(a,b,c):
...        print d
...
4


.. I changed the order of letters to check if I am right.



>>> a=4
>>> b=6
>>> c=8
>>> for d in range(b,c):
...        print b
...
6
6


but then I accidentally mixed values and have instead of "print d", used "print b" - and I got two results one after another, two 6. So, I see one stands for varaiable b, and the other for d, from "for d in range" loop, but how is it possible, what happened, how computer gets that result  ?? 


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/idle-dev/attachments/20031116/316da244/attachment-0001.html


More information about the IDLE-dev mailing list