I have to calculate the sum of consecutive numbers from 1 to N This is my attempt at the code: N= int(input()) for x in range (1 , N): print (x+N) for example if the input is 380 my outputs are: 381 382 383 .... etc anyone can help with the flaw of my code?

4/28/2021 6:10:16 PM

Mwsdo10 Answers

New AnswerN = int(input()) count = N x = range(1, N +1) for i in x: N = i + N print(N - count)

Hot Today

Can any one help me at 25.2 practice of oython
How can I open and display an existing file on my computer with C/C++?
Can any one tell me about how to complete the project in java?
Codes question
I am having problem in this code please someone solve this I have tried so many times to solve this but failed.
Help java problem
Facing problem in R
Remainder of numbers in python
Is the code projects for c++ bugged?
Why do these same codes, output differently?

Sololearn Inc.

535 Mission Street, Suite 1591San Francisco, CA 94105

Β© 2022 Sololearn, Inc.

Send us a message