#solution
nn = int(input(""))
nl = list(input(""))
add = 0
for i in range(nn):
add += int(nl[i],10)
print(add)
list()라는 함수는 자료형을 입력받아 리스트로 만들어 주는 함수이다.
문제출처: 백준
'Write-up > 백준' 카테고리의 다른 글
백준 4673번 - 셀프넘버(python) (0) | 2019.12.27 |
---|---|
백준 5622번 - 다이얼(python) (0) | 2019.12.26 |
백준 2675번 -문자열 반복(python) (0) | 2019.12.26 |
백준 2562번 - 최댓값(python) (0) | 2019.12.22 |
백준 2577번 - 숫자의 개수(python) (0) | 2019.12.22 |