Python漫漫长路

L = ['Hello', 'World', 18, 'Apple', None]

for s in L:

    if isinstance(s,str):
        print('测试通过!')
    else:
        print('测试不通过')

str是python中字符串类型

习惯了string,找了半天问题,str不是没定义没,真的是心累

猜你喜欢

转载自blog.csdn.net/m0_37471638/article/details/82218769