# !/usr/bin/env python3 # --coding:utf-8-- l = ['Hello', 'World', 18, 'Apple', None] print([s.lower() for s in l if isinstance(s,str)==True]) print([x.lower() if isinstance(x,str) else x for x in l])
print([x.lower() if isinstance(x,str) else x for x in l])
这句语法显然错误
Sign in to make a reply
SingleChauncey