python判断变量类型是否为List列表
li =["hello","python","list"]
print(type(li))
if isinstance(li,list):
print("This is a List")
以上返回结果为:
<class 'list'>
This is a List
li =["hello","python","list"]
print(type(li))
if isinstance(li,list):
print("This is a List")
以上返回结果为:
<class 'list'>
This is a List