[Tutor] finding special character string
bob gailer
bgailer at gmail.com
Sun Jun 1 14:22:41 CEST 2008
Dinesh B Vadhia wrote:
> A text document has special character strings defined as "." + "set of
> characters" + ".". For example, ".sup." or ".quadbond." or ".degree."
> etc. The length of the characters between the opening "." and closing
> "." is variable.
>
> Assuming that you don't know beforehand all possible special character
> strings, how do you find all such character strings in the text document?
This sounds like a homework assignment. We don't offer solutions to
homework, but are glad to help out after you have tried to write a
program and run into blocks or specific problems.
Are you studying Python? What have you learned that you could apply to
this problem?
Is the text document available as a computer file or is it on paper?
The specification is what I'd call informal rather than precise. I'd ask
the author of the specification to make it more precise. I deem this
important because endless problems arise when the user does not get what
he wanted from the programmer, architect, engineer, relationship,
you-name-it, and the reason is the supplier provided what he thought the
user wanted.
Precise specification helps ensure desired results. Even in human
relationships!
OK - what next? How do you react to what I said?
--
Bob Gailer
919-636-4239 Chapel Hill, NC
More information about the Tutor
mailing list