From 70b851d4cd3600754ec332326b55eeb47e5fe8e4 Mon Sep 17 00:00:00 2001 From: yashkumarjha12 <72943344+yashkumarjha12@users.noreply.github.com> Date: Thu, 7 Oct 2021 17:12:54 +0530 Subject: [PATCH] Create Sum of first N natural nos. --- Python/Sum of first N natural nos. | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Python/Sum of first N natural nos. diff --git a/Python/Sum of first N natural nos. b/Python/Sum of first N natural nos. new file mode 100644 index 0000000..251cc68 --- /dev/null +++ b/Python/Sum of first N natural nos. @@ -0,0 +1,6 @@ +num = int(input("Enter the Number:")) +value = 0 +for i in range(1, num+1): + value = value + i + +print("Sum of N natural numbers:", value)