I face some issue in python topic While loop in show some error

please find the attachment


problem:-

5,9,12,14,15

Sum = 0
n = int(input("N : "))
while n>0:
sum = sum+n
n-=1
print("Sum : ",sum)
print(“Bye”)
ERROR:
N : 5

TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_1784/2571524625.py in
4 n = int(input("N : "))
5 while n>0:
----> 6 sum = sum+n
7 n-=1
8 print("Sum : ",sum)

TypeError: unsupported operand type(s) for +: ‘builtin_function_or_method’ and ‘int’

sum=0

n=int(input("Enter number: "))

while n>0:

sum=sum + n

n=n-1

print("sum:",sum)

print()