Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

travel data science

백준 11022번 본문

Python study

백준 11022번

가방이 2021. 10. 3. 20:55
import sys

for i in range(int(sys.stdin.readline())):
    a=list(map(int, sys.stdin.readline().split()))
    print("Case #{}: {} + {} = {}".format(i+1, a[0], a[1], sum(a)))

map오류가 떴는데

map함수를 list로 안감싸줘서 그런 오류가 떴던 것이다.

 

+ 깨달은 점 하나 더, list를 sum()함수에 집어 넣으면 모든 인자들의 합계가 간단하게 나온다.

'Python study' 카테고리의 다른 글

백준 1110번 문제  (0) 2021.10.04
백준 10951번 문제  (0) 2021.10.03
백준 15552번  (0) 2021.10.03
재귀호출 알고리즘  (0) 2021.09.30
[python basic] 3. 데이터 타입과 컬렉션  (0) 2021.09.02