diff --git a/python/beginner/sum_of_all_numbers_suryashankardas.py b/python/beginner/sum_of_all_numbers_suryashankardas.py new file mode 100644 index 0000000..574ac15 --- /dev/null +++ b/python/beginner/sum_of_all_numbers_suryashankardas.py @@ -0,0 +1,15 @@ +input_list = [] +for i in range(2): + input_list.append(int(input("enter no: "))) + + +def sum_all(a): + if a[0] > a[1]: + a[0], a[1] = a[1], a[0] + sum = 0 + for n in range(a[0], a[1] + 1): + sum += n + return sum + + +print(sum_all(input_list)) \ No newline at end of file