def solution(absolutes, signs):
answer = 0
for i in range(len(signs)):
if signs[i] == True:
answer += absolutes[i]
elif signs[i] == False:
answer -= absolutes[i]
return answer
'문제풀이 > 프로그래머스' 카테고리의 다른 글
[프로그래머스][Lv1] - 두 개 뽑아서 더하기 (Python) (0) | 2021.10.17 |
---|---|
[프로그래머스][Lv1] - 같은 숫자는 싫어 (Python) (0) | 2021.10.17 |
[프로그래머스][Lv1] - 없는 숫자 더하기 (Python) (0) | 2021.10.17 |
[프로그래머스][Lv2] - 더 맵게 (Python) (0) | 2021.10.15 |
[프로그래머스][Lv1] - [1차] 비밀지도 (Python) (0) | 2021.10.15 |