Discuss / Python / 第一题

第一题

Topic source

胖头鱼

#1 Created at ... [Delete] [Delete and Lock User]
def normalize(name):    while name[:1]==' ':        name=name[1:]    while name[-1:]==' ':        name=name[:-1]      return name[0].upper()+name[1:].lower()L1 = ['adam', 'LISA', 'barT']L2 = list(map(normalize, L1))print(L2)

  • 1

Reply