What I’ve tried:
>> abcd = [u'abcd']
>> abcd_ef = abcd + 'ef'
>> abcd_ef
[u'abcd', 'e', 'f']
What I’d like:
>> abcd = [u'abcd']
>> abcd_ef = **MAGIC ???**
>> abcd_ef
[u'abcd', 'ef']
Hopefully I made that clear enough!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make it a list:
otherwise the list adds each element (e.g. each character) of the string separately.
Alternatively, you can call
.append()onabcdand modify that list in-place:This is all standard python list manipulation and is independent of the contents; it doesn’t matter if there are unicode objects or custom objects in that list.