Bonjour,
d = [' CB ', ' CG1', ' CG2', 15.145]
def mon_strip(s): return s.strip() if isinstance(s,str) else s
d = list(map(mon_strip,d))
print(d)
Ajouté : ou bien
d = [' CB ', ' CG1', ' CG2', 15.145]
d = list(map(lambda x:x.strip() if isinstance(x,str) else x,d))
print(d)