a = ('a', 'b', 'c')
print( ''.join(a) )
What is the meaning of '' on the line two? Does string module and this '' object has any difference?
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.
''means an empty string to which we join another string. It’s a more pythonic way to do string concatenation.Check this out for more insights: http://www.skymind.com/~ocrow/python_string/
PEP3126 Says (although its rejected):
So, both are same things, join is just more pythonic.