Re: [Tutor] How to improve

2007-07-16 Thread taserian
Thank you both, Alan and Gregor. Sorry I didn't reply earlier; just a bit overwhelmed with a family situation over here. Alan, looks like I'll have to go over list comprehension as a way to initialize variables. I recall when I first started programming this, I tried wordlist = [] * 31, completel

Re: [Tutor] How to improve

2007-07-12 Thread Gregor Lingl
taserian schrieb: > I've been programming for years before encountering Pythoin, but in > much more verbose languages, and I appreciate the fact that Python is > so terse and still accomplishes so much. Still, I have difficulty > thinking in Python, and tend to revert to longer programs for what

Re: [Tutor] How to improve

2007-07-12 Thread Alan Gauld
"taserian" <[EMAIL PROTECTED]> wrote > I'd like to see how I could improve the program below for this, and > make it > more Python-ish. > > = = = = START > > def decompose(longword): >word1 = longword[0::2] >word2 = longword[1::2] >return (word1, word2) This seems OK to me. > wordl

[Tutor] How to improve

2007-07-12 Thread taserian
I've been programming for years before encountering Pythoin, but in much more verbose languages, and I appreciate the fact that Python is so terse and still accomplishes so much. Still, I have difficulty thinking in Python, and tend to revert to longer programs for what seems to be simple tasks. S