joe-amoah / python-learning

for learning python
MIT License
1 stars 0 forks source link

Exercise 7: Sum of the First n Positive Integers #10

Open Prince-linux opened 4 years ago

Prince-linux commented 4 years ago

Write a program that reads a positive integer, n, from the user and then displays the sum of all of the integers from 1 to n. The sum of the first n positive integers can be computed using the formula: sum = (n)(n + 1)/2