Advertisement
immanual1

2a

Jan 13th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. def sum_of_n(n):
  2. return (n * (n + 1)) // 2
  3.  
  4. n = int(input("Enter the value of N: "))
  5. sum = sum_of_n(n)
  6. print("Sum of the series:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement