python判断变量类型是否为List列表

li =["hello","python","list"]
print(type(li))

if isinstance(li,list):
    print("This is a List")

以上返回结果为:
<class 'list'>
This is a List

posted @ 2020-05-21 23:00  莫贞俊晗  阅读(7392)  评论(0编辑  收藏  举报