Margie's Tech Blog
Mostly Linux & Python syntax notes and hyperlinks.
Tuesday, November 29, 2011
python: note the non-intuitive behavior of range(start,end+1)
range(a,b) starts at a and ends at b-1
>>> for n in range(1,3):
... print str(n)
...
1
2
>>>
You could introduce bugs in your code by not being careful of this.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2024
(1)
►
September
(1)
►
2023
(4)
►
July
(1)
►
April
(1)
►
March
(2)
►
2020
(2)
►
July
(1)
►
March
(1)
►
2019
(2)
►
October
(1)
►
August
(1)
►
2018
(2)
►
April
(2)
►
2017
(2)
►
May
(1)
►
April
(1)
►
2016
(8)
►
March
(3)
►
February
(3)
►
January
(2)
►
2015
(10)
►
December
(2)
►
June
(1)
►
May
(1)
►
April
(2)
►
March
(4)
►
2014
(20)
►
December
(2)
►
November
(4)
►
August
(5)
►
July
(4)
►
June
(1)
►
March
(3)
►
January
(1)
►
2013
(8)
►
September
(1)
►
July
(1)
►
June
(3)
►
May
(3)
►
2012
(5)
►
June
(1)
►
May
(2)
►
March
(2)
▼
2011
(14)
▼
November
(2)
python: note the non-intuitive behavior of range(s...
python: 2-D dictionary, somewhat dynamically filled
►
October
(2)
►
August
(1)
►
June
(2)
►
May
(3)
►
April
(1)
►
March
(1)
►
January
(2)
►
2010
(37)
►
December
(1)
►
October
(4)
►
August
(2)
►
June
(6)
►
May
(1)
►
April
(2)
►
March
(12)
►
February
(4)
►
January
(5)
►
2009
(12)
►
December
(1)
►
November
(2)
►
September
(3)
►
August
(6)
About Me
Margery
View my complete profile
No comments:
Post a Comment