Re: Else statement executing when it shouldnt

2013-01-23 Thread Thomas Boell
On Tue, 22 Jan 2013 17:28:35 -0800 (PST) alex23 wrote: > On Jan 23, 1:48 am, Thomas Boell wrote: > > I must say, that's bound to be confusing for anyone who knows any > > language other than Python (or none, even).  Syntax like that is "an > > accident waiting to

Re: Else statement executing when it shouldnt

2013-01-22 Thread Thomas Boell
On Wed, 23 Jan 2013 02:42:27 +1100 Chris Angelico wrote: > On Wed, Jan 23, 2013 at 2:39 AM, Thomas Boell wrote: > > Huh?! I would have expected all your examples to raise a SyntaxError or > > IndentationError. Why don't they? Is 'else' not required to have a > &

Re: Else statement executing when it shouldnt

2013-01-22 Thread Thomas Boell
On Mon, 21 Jan 2013 06:07:08 +0100 René Klačan wrote: > Examples: > > # else branch will be executed > i = 0 > while i < 5: > i += 1 > else: > print('loop is over') > > > # else branch will be executed > i = 0 > while i < 5: > i += 1 > if i == 7: > print('i == 7') >

Re: average time calculation??

2013-01-12 Thread Thomas Boell
On Thu, 10 Jan 2013 09:50:37 -0800 (PST) pmec wrote: > Hi there guys i've got a script that's suppose to find the average of two > times as strings. The times are in minutes:seconds:milliseconds > i'm doing ok in printing the right minutes and seconds my problem is with the > milliseconds. > >

Re: a little parsing challenge ☺

2011-07-17 Thread Thomas Boell
On Sun, 17 Jul 2011 02:48:42 -0700 (PDT) Raymond Hettinger wrote: > On Jul 17, 12:47 am, Xah Lee wrote: > > i hope you'll participate. Just post solution here. Thanks. > > http://pastebin.com/7hU20NNL I'm new to Python. I think I'd have done it in a similar way (in any language). Your use of o