July 20, 2011 6:11 PM
Subject: Re: [Tutor] Homework problem
Ken Baclig wrote:
> Hi,
>
> I'm trying to make a function that receives text (a string) as an argument
> and returns the same text (as string), but with 1 added to each word that is
> a number.
What counts as a n
Ken Baclig wrote:
Hi,
I'm trying to make a function that receives text (a string) as an argument and
returns the same text (as string), but with 1 added to each word that is a
number.
What counts as a number? In the string:
"Hello world 1234 ham spam"
which of these do you expect to get b
Ken Baclig wrote:
Does this look right? Still a little confused
Nope.
Notice that Marc said NOT to operate on characters but to split() the
string into a wordlist. Then test for each word in the wordlist to see
if it isdigit(). Igf so then convert the word to an int() and add one.
Then
2011 3:45 PM
Subject: Re: [Tutor] Homework problem
On Wed, Jul 20, 2011 at 2:54 PM, Ken Baclig wrote:
Hi,
>
>
>I'm trying to make a function that receives text (a string) as an argument and
>returns the same text (as string), but with 1 added to each word that is a
>nu
On Wed, Jul 20, 2011 at 2:54 PM, Ken Baclig wrote:
> Hi,
>
> I'm trying to make a function that receives text (a string) as an argument
> and returns the same text (as string), but with 1 added to each word that is
> a number.
>
> I need help getting started.
>
> So far, I have:
>
> def FindNumbe
Hi,
I'm trying to make a function that receives text (a string) as an argument and
returns the same text (as string), but with 1 added to each word that is a
number.
I need help getting started.
So far, I have:
def FindNumbers(a_string):
for index, char in enumerate(a_string):
if
On 03/03/2011 04:58 PM, James Reynolds wrote:
> You are almost assuredly going to get flamed for not having a descriptive
> title and for asking what is obviously homework questions
>
Maybe for not having a descriptive title, but there's nothing wrong with
coming to the list with homework!
The r
"Shawn Blazer" wrote
This problem told me to use map and filter, so how would I use that
to solve it?
Because its homework we won't solve it for you, we will only
answer questions or suggest approaches.
From your earlier post it looks like you have all the tools:
recursion, map and filte
On Fri, 28 May 2010 19:11:13 -0400
"Shawn Blazer" wrote:
>
> This problem told me to use map and filter, so how would I use that to
> solve it?
[some piece of interactive session]
> Thanks!
So, where's the problem?
Denis
vit esse estrany ☣
spir.wikidot.com
This problem told me to use map and filter, so how would I use that to
solve it?
remove ( 5 , 6 )
6
remove ( 5 , 5 )
remove ( 1 , [1 , [1 , [2 , 13]] , 1 , [2] , 5] )
[[[2 , 13]] , [2] , 5]
remove ( 2 , [1 , [1 , [2 , 13]] , 1 , [2] , 5] )
[1 , [1 , [13]] , 1 , [] , 5]
Thanks!
--
Usi
10 matches
Mail list logo