From aa9c0e4f6c9c7b85c0c8eb7e21541acbfcb8361c Mon Sep 17 00:00:00 2001 From: aiiimzzz634 <86428985+aiiimzzz634@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:51:37 +0530 Subject: [PATCH] Create sum.py --- sum.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sum.py diff --git a/sum.py b/sum.py new file mode 100644 index 0000000..378ff41 --- /dev/null +++ b/sum.py @@ -0,0 +1,8 @@ +sum = 0 +print("Enter the Value of n: ") +n = int(input()) +print("Enter " + str(n) + " Numbers: ") +for i in range(n): + num = int(input()) + sum = sum+num +print("Sum of " + str(n) + " Numbers = " + str(sum))