On 6/26/2012 1:10 AM Alan Gauld said...
On 26/06/12 02:22, Steven D'Aprano wrote:
I think you've messed up your quoting. It was Mike Nickey, not Emile,
who suggested using w[0] == 'x'.
Yes, but Emile's comment was in context of Mike's assertion about w[0].
However, reading it back I think tha
On 26/06/12 02:22, Steven D'Aprano wrote:
I think you've messed up your quoting. It was Mike Nickey, not Emile,
who suggested using w[0] == 'x'.
Yes, but Emile's comment was in context of Mike's assertion about w[0].
However, reading it back I think that the "This" in Emile's comment was
actu
Alan Gauld wrote:
Hi Emile,
On 26/06/12 00:26, Emile van Sebille wrote:
Try using the operator that checks for equality such as
if w[0] == 'x':
This does the same thing and works even when w is an empty string.
Umm, so does startswith()? Can you clarify what you mean by the last
sentence?
Hi Emile,
On 26/06/12 00:26, Emile van Sebille wrote:
Try using the operator that checks for equality such as
if w[0] == 'x':
This does the same thing and works even when w is an empty string.
Umm, so does startswith()? Can you clarify what you mean by the last
sentence?
--
Alan G
Author
On 25/06/12 23:12, Mike Nickey wrote:
I did the same exercise so maybe I can assist here. From what I see, the line...
if w.startswith('x'): seems to be ineffective.
If that's true you have a seriously broken version of Python!
startswith() is a better idiom because it conveys the intent much
On 6/25/2012 3:12 PM Mike Nickey said...
The problem with this code is that it only gets the first word beginning
with x and the others remaisn on the original list, sorted at the end. I've
tested on terminal many parts of the code and it whas fine, but when I run
it complete, it does not work.
>> The problem with this code is that it only gets the first word beginning
>> with x and the others remaisn on the original list, sorted at the end. I've
>> tested on terminal many parts of the code and it whas fine, but when I run
>> it complete, it does not work.
>>
>> Following is the solution