Re: [Tutor] Character Buffer Object Error

2012-02-09 Thread Michael Lewis
On Thu, Feb 9, 2012 at 2:43 PM, bob gailer wrote: > Always reply-all so a copy goes to the tutor list. > > On 2/8/2012 11:04 PM, Michael Lewis wrote: > > Thanks Bob, > > Thanks for what if you did not follow my suggestions? > I partially followed your suggestions by getting rid of str.replace(old

Re: [Tutor] Character Buffer Object Error OOPS

2012-02-09 Thread bob gailer
On 2/8/2012 11:04 PM, Michael Lewis wrote: Thanks Bob, My Bad - I did not examine all your code - I broke my own rule. Your code is still a little buggy. The below code is what I came up with without using your suggestion. On a scale, how novice is mine compared to what you offered? I am cu

Re: [Tutor] Character Buffer Object Error

2012-02-09 Thread bob gailer
Always reply-all so a copy goes to the tutor list. On 2/8/2012 11:04 PM, Michael Lewis wrote: Thanks Bob, Thanks for what if you did not follow my suggestions? Your code is still pretty buggy. Please test it by running it, seeing that the result is not correct, then try the desk checking.

Re: [Tutor] Character Buffer Object Error

2012-02-08 Thread bob gailer
On 2/8/2012 12:56 AM, Michael Lewis wrote: I want to find all digits in a string and then increment those digits by 1 and then return the same string with the incremented digits. [snip] You got lots of good advice from others and some not-so-good advice. Michael said: 2. The following line app

Re: [Tutor] Character Buffer Object Error

2012-02-08 Thread Alan Gauld
On 08/02/12 05:56, Michael Lewis wrote: I've tried the following code, but I am getting the following error. How do I do this properly? Christian answered the reason for the error. Here are some other comments... def AlterInput(user_input): print user_input new_output = '' make t

Re: [Tutor] Character Buffer Object Error

2012-02-07 Thread Asokan Pichai
Dear Michael Overall I see a few problems. 0. Functions should return values. Not print them 1. Why use enumerate? The code is not using the index anyway 2. The following line appears wrong. new_output = ' '.join(user_input) 3. This line has a very buggy possibility.

Re: [Tutor] Character Buffer Object Error

2012-02-07 Thread Christian Witts
On 2012/02/08 07:56 AM, Michael Lewis wrote: I want to find all digits in a string and then increment those digits by 1 and then return the same string with the incremented digits. I've tried the following code, but I am getting the following error. How do I do this properly? def AlterInput(

[Tutor] Character Buffer Object Error

2012-02-07 Thread Michael Lewis
I want to find all digits in a string and then increment those digits by 1 and then return the same string with the incremented digits. I've tried the following code, but I am getting the following error. How do I do this properly? def AlterInput(user_input): print user_input new_output =