Discuss / Python / 交作业—第一题

交作业—第一题

Topic source

oy-冲弱

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

name = ['adam', 'LISA', 'barT'] def normalize(name): l = list(name) l[0] = l[0].upper() for i in range(len(l)-1): l[i+1] = l[i+1].lower() s = ''.join(l) return s s = map(normalize,name) l = list(s) print(l)

好烦琐。


  • 1

Reply