Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #45651
| From | Jussi Piitulainen <jpiitula@ling.helsinki.fi> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: How to run a python script twice randomly in a day? |
| Date | 2013-05-21 11:21 +0300 |
| Organization | University of Helsinki |
| Message-ID | <qotwqqsrbe4.fsf@ruuvi.it.helsinki.fi> (permalink) |
| References | <CAEA17E+UpccfENQJEZv_Pp+5P00PUnhHvdztZ0ofMJZF67fdVA@mail.gmail.com> <20130521011220.GA62488@cskk.homeip.net> <mailman.1908.1369122996.3114.python-list@python.org> |
Chris Angelico writes: > > On 20May2013 15:05, Avnesh Shakya wrote: > > So your call picks a number from 0..58, not 0..59. > > Say randrange(0,60). Think "start, length". > > Nitpick: It's not start, length; it's start, stop-before. If the > start is 10 and the second argument is 20, you'll get numbers from > 10 to 19. But your conclusion is still accurate :) I've sometimes named the latter index "past", as in just past the range. I'm also happy to call it just "end". The inclusive-style names might be "first" and "last", so "past" is "last + 1". The length of the range from "start" to "end" is "end - start" without a "pest" term that is either -1 or +1 though I forget which; two consecutive ranges are from b to m, then from m to e; an empty range is from b to b.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: How to run a python script twice randomly in a day? Chris Angelico <rosuav@gmail.com> - 2013-05-21 17:56 +1000
Re: How to run a python script twice randomly in a day? Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-05-21 11:21 +0300
Re: How to run a python script twice randomly in a day? Chris Angelico <rosuav@gmail.com> - 2013-05-21 19:18 +1000
csiph-web