s = ['1', '2', '3']
list_int = list(map(int, s))
print(list_int)
map() 会根据提供的函数对指定序列做映射。
语法:map(function, iterable, ...)
参数:
- function – 函数
- iterable – 一个或多个序列
返回值
- Python 2.x 返回列表。
- Python 3.x 返回迭代器。
s = ['1', '2', '3']
list_int = list(map(int, s))
print(list_int)
map() 会根据提供的函数对指定序列做映射。
语法:map(function, iterable, ...)
参数:
返回值