No one likes homework, but your math teacher has given you an assignment to find the sum of the first N numbers. Let’s save som | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

No one likes homework, but your math teacher has given you an assignment to find the sum of the first N numbers. Let’s save som

30th Sep 2021, 10:11 AM
Harsha Yerramilli
Harsha Yerramilli - avatar
7 Answers
+ 8
Aleksei Radchenkov , as already mentioned: please help us to keep sololearn what it is made for: It is a self-learning platform. So this means, that we should avoid giving codes when people ask for this, before they have done a try by themselves and before they have present it here. It looks really helpful when you post a code as you did, but it does not help the OP. This will be a copy and paste - and the coding skills and problem solving ability will not grow. What we should do is to give HINTS or COMMENTS how to solve the task. thanks for your understanding.
30th Sep 2021, 10:32 AM
Lothar
Lothar - avatar
+ 6
Harsha , your post is incomplete / truncated and we miss your attempt. before we can help you, you should show us your attempt first. if you have not done a try by yourself upto now, please do so. Put your code in playground and link it here. thanks!
30th Sep 2021, 10:35 AM
Lothar
Lothar - avatar
+ 1
are you having trouble solving this?
30th Sep 2021, 10:22 AM
Erlénio.RS
Erlénio.RS - avatar
30th Sep 2021, 10:26 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
Lothar , I was just quite sure this was some sort of very "unchallenging" challenge... (Because of the way this question is written)
30th Sep 2021, 10:41 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
n = int(input()) Mathematical Solution Ans= n*(n+1)/2 Brute forcing Ans = sum(range(n+1))
1st Oct 2021, 8:24 PM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar
0
I don't even know i posted this im new here sorry
30th Sep 2021, 5:00 PM
Harsha Yerramilli
Harsha Yerramilli - avatar