Prepending string "@" to usernames

Mark Lawrence breamoreboy at yahoo.co.uk
Fri May 24 19:16:34 EDT 2013


On 25/05/2013 00:04, Thomas Murphy wrote:
>> Maybe this is what you're looking for?
>>
>> raw_address = "cookielover93 TheGermanHatesSaurkraut WhatsThatBoy932834"
>> address_library = raw_address.split()
>> print address_library
>>
>> final_address = []
>> for address in address_library:
>>      final_address.append("@" + str(address))
>> print final_address
>>
> Exactly it. Thank you so much Dan. Perfect!
>
>
>
> --
> Sincerely,
> Thomas Murphy
> Code Ninja
> 646.957.6115
>

You can safely remove the call to str as address is already a string.

-- 
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence




More information about the Python-list mailing list