+ 1
Sometimes someone got to know what's so simple error in my phyton project calculating the first sum of consecutive numbers in
N = int(input()) #your code goes here N =N+1 list = [N] sum = 0 for x in list : sum+=x print(sum)
3 Answers
+ 1
It should be
for x in range(N)
list = [N] is a list that only contains N, so the sum would be only N
+ 1
Thanks Lisa
0
Hi Ermias!
Someone asked the same thing a week ago. The reason for sharing this post with you that you can get more different ideas from this community members.
https://www.sololearn.com/Discuss/2849490/?ref=app