python疑问
>>> list(map(str, [1, 2, 3, 4, 5, 6, 7, 8, 9]))
['1', '2', '3', '4', '5', '6', '7', '8', '9']
是对的
def format_name(s):
return s.capitalize()
list(map(format_name, ['adam', 'LISA', 'barT']))
为什么我前面不加print就报错呢?
>>> list(map(str, [1, 2, 3, 4, 5, 6, 7, 8, 9]))
['1', '2', '3', '4', '5', '6', '7', '8', '9']
是对的
def format_name(s):
return s.capitalize()
list(map(format_name, ['adam', 'LISA', 'barT']))
为什么我前面不加print就报错呢?
2016-11-12
举报