Re: [Tutor] Changing only intergers in a list of strings

2014-02-05 Thread Juan Manuel Lopez Baio
On Wed, Feb 5, 2014 at 7:47 AM, David Palao wrote: > Sorry, there is a typo: > "(num+a,)" should be "(num+1,)", obviously. > > 2014-02-05 David Palao : >> Hi, >> Is it not clear to me if you must distinguish ints from other type of >> numbers, or if, for instances floats and ints must be dealt >>

Re: [Tutor] Changing only intergers in a list of strings

2014-02-05 Thread David Palao
Sorry, there is a typo: "(num+a,)" should be "(num+1,)", obviously. 2014-02-05 David Palao : > Hi, > Is it not clear to me if you must distinguish ints from other type of > numbers, or if, for instances floats and ints must be dealt > differently. > Anyway, I would propose something like the follo

Re: [Tutor] Changing only intergers in a list of strings

2014-02-05 Thread David Palao
Hi, Is it not clear to me if you must distinguish ints from other type of numbers, or if, for instances floats and ints must be dealt differently. Anyway, I would propose something like the following function: def FindNumbers(a_string): print "You entered:", a_string out_list = [] for

[Tutor] Changing only intergers in a list of strings

2014-02-05 Thread Colin Struthers
I am in a beginning python course and am working through some code and I can't even figure out how to start building this particular section of code. My goal is to get a sentence for the user and to take each number in the user string and add 1 to each number. i.e "the 4 people had 6 dogs" would c