Re: [Tutor] string indexing -- side note, rather OT

2014-01-20 Thread spir
On 01/20/2014 01:19 AM, Keith Winston wrote: On Sun, Jan 19, 2014 at 3:50 PM, Alan Gauld wrote: How would Python know whether you want find for gettext, mmap, str, xml.etree.ElementTree.Element or xml.etree.ElementTree.ElementTree? Absolutely, but a newbie doesn't even guess that more than o

Re: [Tutor] string indexing

2014-01-20 Thread Alan Gauld
On 20/01/14 07:37, rahmad akbar wrote: Spir and Peter, thanks for the specifics, super helpful. Alan, super thanks for the general advice, you guys are awesome!! You are welcome, but please don't post an entire digest just to say thanks. It uses up bandwidth and storage unnecessarily and some

Re: [Tutor] string indexing

2014-01-20 Thread rahmad akbar
ng text tends to lead programmers > to be verbally based. But algorithms, state machines, logic, data > structures, GUIs, formal requirements and OOP all have well > established visual representations, and in many cases they > are formalized so that, with the right tools, you c

Re: [Tutor] string indexing

2014-01-19 Thread Keith Winston
On Sun, Jan 19, 2014 at 3:50 PM, Alan Gauld wrote: >> How would Python know whether you want find for gettext, mmap, str, >> xml.etree.ElementTree.Element or xml.etree.ElementTree.ElementTree? > > > Absolutely, but a newbie doesn't even guess that more than one find would > exist. Or even that the

Re: [Tutor] string indexing

2014-01-19 Thread Alan Gauld
On 19/01/14 19:53, Mark Lawrence wrote: On 19/01/2014 19:34, Keith Winston wrote: Erm, getting what you want from help can be work. Help(find) # doesn't work at all. How would Python know whether you want find for gettext, mmap, str, xml.etree.ElementTree.Element or xml.etree.ElementTree

Re: [Tutor] string indexing

2014-01-19 Thread Mark Lawrence
On 19/01/2014 19:34, Keith Winston wrote: On Sun, Jan 19, 2014 at 11:33 AM, Alan Gauld wrote: help(''.find) Help on built-in function find: Erm, getting what you want from help can be work. Help(find) # doesn't work at all. How would Python know whether you want find for gettext, mmap,

Re: [Tutor] string indexing

2014-01-19 Thread Keith Winston
On Sun, Jan 19, 2014 at 11:33 AM, Alan Gauld wrote: help(''.find) > Help on built-in function find: Erm, getting what you want from help can be work. Help(find) # doesn't work at all. What Alan did above was create an empty string, by using two single quotes next to each other ('', not t

Re: [Tutor] string indexing

2014-01-19 Thread Alan Gauld
On 19/01/14 13:59, rahmad akbar wrote: hey guys, super noob here, i am trying to understand the following code from google tutorial which i failed to comprehend Others have answered the specifics but some general advice here: 1) never forget the Python >>> prompt. Try things out if you don't

Re: [Tutor] string indexing

2014-01-19 Thread Peter Otten
rahmad akbar wrote: > hey guys, super noob here, i am trying to understand the following code > from google tutorial which i failed to comprehend > > #code start > # E. not_bad > # Given a string, find the first appearance of the > # substring 'not' and 'bad'. If the 'bad' follows > # the 'not',

Re: [Tutor] string indexing

2014-01-19 Thread spir
On 01/19/2014 02:59 PM, rahmad akbar wrote:> hey guys, super noob here, i am trying to understand the following code from google tutorial which i failed to comprehend #code start # E. not_bad # Given a string, find the first appearance of the # substring 'not' and 'bad'. If the 'bad' follows #

[Tutor] string indexing

2014-01-19 Thread rahmad akbar
hey guys, super noob here, i am trying to understand the following code from google tutorial which i failed to comprehend #code start # E. not_bad # Given a string, find the first appearance of the # substring 'not' and 'bad'. If the 'bad' follows # the 'not', replace the whole 'not'...'bad' subs