https://school.programmers.co.kr/learn/courses/30/lessons/120841
def solution(dot):
if dot[0] > 0:
if dot[1] > 0:
return 1
else:
return 4
if dot[0] < 0:
if dot[1] > 0:
return 2
else:
return 3
x
좌표가 양수일 때, 음수일 때를 기준으로 분기시켰다.def solution(dot):
x, y = dot
if x * y > 0:
return 1 if x > 0 else 3
else:
return 4 if x > 0 else 2
dot[i]
같은 구조가 아니라 x, y
로 변수에 담았으면 가독성이 더 향상될것 같다.피드백은 언제나 환영입니다 :)