목록map (1)
IT 세계의 후아
[python]map 함수
※ map(function, iterable)iterable 데이터 요소들에 function을 적용# 백준 10869a, b = input("").split()print(int(a) + int(b))# map 활용a, b = map(int, input().split())print(a + b) # 프로그래머스 lv0 배열 원소의 길이["we", "are", ...] => [2, 3, ...]def solution(strlist): return [len(i) for i in strlist] # return list(map(len, strlist))
Coding/Python
2024. 3. 14. 12:13