Discuss / Python / 第1小题练习

第1小题练习

Topic source

生菜菜吖

#1 Created at ... [Delete] [Delete and Lock User]

def normalize(name): i=0 j=len(name)-1 while name[i]==' ': i=i+1 while name[j]==' ': j=j-1 return name[i:j+1].capitalize() L1=[' adam','LISA ','barT ','tOm'] print(list(map(normalize,L1)))


  • 1

Reply