我有这个代码的代码在Python:Python列表和类型错误
if type(data).__name__=='list':
print type(data).__name__
print ",".join(data)
而且它给我这个错误:
print ",".join(data)
exceptions.TypeError: sequence item 0: expected string, list found
这怎么可能?!?
在此先感谢anyhelp。
啊...我很愚蠢......我的列表包含一些名单...抱歉打扰你的所有。但是,无论如何感谢关于isinstance – kirikouille 2011-05-03 14:40:53