out = 'Hello'
print( out.join([' world']) )
When I run it, it shows
world
Isn’t it supposed to print hello world?
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.
No, it joins the elements of the list with the word
'Hello'. For example, if you had['A', 'B'], it would produce'AHelloB'. Since there is only one element in your list, there is nothing to join, so it can just return the only element in there unchanged.What you wanted is probably something like
' '.join(['Hello', 'world']).