由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Python: 有一个混合了子list和string的list, 如何判断元素是list还是string?
相关主题
python gc question问个用python scratch yelp html 数据的问题
问一个python的string split问题问个PYTHON烂问题
Can I force/convert a string obj to a file obj in python ?Python:请问如何把list变成structured array。
没人觉得python的string是immutable不爽吗?问个python小问题
python string的问题请问有没有关于python的一个常见问题集
(char **)返回值怎么用SWIG包成Python list (of stringspython 问题,急,在线等。
Python: how to match the price string starting with $ ?来个PYTHON LIST COMPREHENSION的问题
急问,有包子,怎样提高SCRIPT 的EFFICIENCY.请教个javascript的问题 (转载)
相关话题的讨论汇总
话题: list话题: string话题: python话题: 元素话题: 混合
进入Programming版参与讨论
1 (共1页)
O*****c
发帖数: 171
1
Python: 有一个混合了子list和string的list, 如何判断元素是list还是string?
比如一个 isstring, islist之类的function or methods
thanks
P***t
发帖数: 1006
2
search isinstance
O*****c
发帖数: 171
3
thanks a lot! :)

【在 P***t 的大作中提到】
: search isinstance
r****t
发帖数: 10904
4

But it is suggested to use
try:
____element + "a"
____#element is a string
except:
____element[:]
____#element is a list

【在 O*****c 的大作中提到】
: Python: 有一个混合了子list和string的list, 如何判断元素是list还是string?
: 比如一个 isstring, islist之类的function or methods
: thanks

1 (共1页)
进入Programming版参与讨论
相关主题
请教个javascript的问题 (转载)python string的问题
Pattern matching(char **)返回值怎么用SWIG包成Python list (of strings
[合集] c++的题Python: how to match the price string starting with $ ?
数据类型判断急问,有包子,怎样提高SCRIPT 的EFFICIENCY.
python gc question问个用python scratch yelp html 数据的问题
问一个python的string split问题问个PYTHON烂问题
Can I force/convert a string obj to a file obj in python ?Python:请问如何把list变成structured array。
没人觉得python的string是immutable不爽吗?问个python小问题
相关话题的讨论汇总
话题: list话题: string话题: python话题: 元素话题: 混合