我是python的新手,这只是为了在我的电脑上实现自动化.我想连接列表中的所有项目.问题是
''.join(list)
Run Code Online (Sandbox Code Playgroud)
不会工作,因为它不是字符串列表.
这个网站http://www.skymind.com/~ocrow/python_string/说最有效的方法是
''.join([`num` for num in xrange(loop_count)])
Run Code Online (Sandbox Code Playgroud)
但这不是有效的python ...
有人可以解释在string.join()中包含这种循环的正确语法吗?