-
PROGRAMS
Problem DefinitionMake a Python Function which takes an array or list as input and returns the sum of its elements, for example array[ 1, 2, 3, 4] will return 1 + 2 + 3 + 4 = 10SolutionIn this article, we will go through two different methods of tacklin…
-
PROGRAMS
A sequence is called to Arithmetic series when the difference between two consecutive numbers remains constant throughout the series. If we express the first term as a and the difference between the terms d, then we can generalize any arithmetic progress…
-
PROGRAMS
Any sequence of integers consisting of strictly decreasing values followed by strictly increasing values such that the decreasing and increasing sequence have a minimum length of 2 and the last value of decreasing sequence is the first value of the incre…
-
PROGRAMS
A perfect square is a number that can be expressed as the square of an integer. For example, 4, 9, 16, and 25 are perfect squares because they are equal to 2^2, 3^2, 4^2, and 5^2, respectively. In this article, we will create a Python program to check if…
-
PROGRAMS
A prime number is a positive whole number greater than 1 which is evenly divisible only by 1 and itself. 2, 3, 5, 7, 11, 13 are the first few prime numbers.Some interesting facts about Prime numbers -2 is the only even prime number0 and 1 are not conside…