1부터 input으로 들어온 수까지 for문을 돌려 계속 1씩 증가하며 출력한다.
N = int(input()) total = 0 for i in range(1, N+1): total += i i += 1 print(total)