L1 = ['Hello', 'World', 18, 'Apple', None] L2 = [s.lower() for s in L1 if isinstance(s,str)] L3 =[x for x in range(len(L1))if not isinstance(L1[x],str)] L4 =[L2.insert(y,L1[y]) for y in L3] print(L2)
Sign in to make a reply
金钟铉