2012/9/16 Lorenzo Sutton <[email protected]>
> On 14/09/12 22:12, Francesco Maida wrote:
>
>> Il giorno 13 settembre 2012 23:10, Daniele Zambelli
>> <[email protected]
>> <mailto:daniele.zambelli@**gmail.com<[email protected]>>>
>> ha scritto:
>>
>>
>>
>> Altre due soluzioni:
>>
>> >>> def russianizza(nome):
>> return nome+'sky'
>>
>
> Per la parità , non dovrebbe essere qualcosa come:
>
> def russianizza(nome):
> nomi_maschili_terminanti_in_a = ['Luca','Andrea','Barabba'] # etc.
> if (nome[-1:] == 'a') and (nome not in m nomi_maschili_terminanti_in_a)
> **:
> return nome[:-1] + 'ska'
> else:
> return nome + 'sky'
>
> (certo non funziona con nomi femminili tipo Chantal, Christal, Betty, etc.
giusto per essere picky:
if (nome.endswith('a') [...])
mi piacciono molto endswith e startswith
ciao,
alberto
_______________________________________________
Python mailing list
[email protected]
http://lists.python.it/mailman/listinfo/python