您的位置:首页 > 编程语言 > Python开发

python 学习---isinstance() arg 2 must be a type or tuple of types

2017-05-04 11:16 1016 查看
当使用循环迭代列表时,有时需要判断列表中的内容。

如:L=['HELLO','WENNY',22,'YANXI']

        [s.lower() for s in L if isinstance(s,str)==true]

提示错误:isinstance() arg 2 must be a type or tuple of types

这时可以exit()退出python,然后再重新进入python
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐