[EMAIL PROTECTED] wrote:
> My version is similar to Just one:
>
> from random import shuffle
>
> def scramble_text(text):
> """Return the words in input text string scrambled
> except for the first and last letter."""
> def scramble_word(word):
Nice. You can have functions inside funct
[EMAIL PROTECTED] wrote:
> Just:
>> [previous post, hand inserted]
>>> def scramble_text(text):
>>> def scramble_word(word):
>>
>> Btw. I find the use of a nested function here completely bogus: you
>> don't need the surrounding scope.
>
> I don't agree, nested functions are useful to better st
Just wrote:
> In article <[EMAIL PROTECTED]>,
> Pedro Graca <[EMAIL PROTECTED]> wrote:
>
[snip: very un-pythonic code]
>
> def curious(text):
> """ Return the words in input text scrambled except for the
> first and last le
I'm sure this isn't very pythonic; comments and advice appreciated
def curious(text):
""" Return the words in input text scrambled except for the first and
last letter. """
new_text = ""
word = ""
for ch in text:
if ch in "abcdefghijklmnopqrstuvwxy