#sigma calculator
q=int(input("숫자를 입력하세요:"))
Sigma=0
for i in range(1,q+1):
Sigma +=i
print(Sigma)
def sigma_sum(n):
tot =0
for i in range(1,n+1):
tot= tot+i
return tot
print(f'ex1 결과:{sigma_sum(10000)}')
#방법2
def sigma_sum_2(n):
return n*(n+1)//2
print(f'ex2 결과:{sigma_sum_2(10000)}')
def sigma_sum_3(n):
return sum(range(n+1))
print(f'ex3 결과:{sigma_sum_3(10000)}')