>>> L1=["ShenZhen","GuangZhou",26,30,"ChangSha"] #定义列表L1,内容有字符串及数字 >>> L2=[s.lower() for s in L1 if isinstance(s,str)] #将L1中的字符串转换成小写并赋值给L2 >>> L2 #打印L2结果 ['shenzhen', 'guangzhou', 'changsha']