-
PYTHON
Insertion SortInsertion sort is a popular shorting algorithm, similar to selection sort the unsorted list or array is divided into to two parts, left part being sorted which is initially empty and the right part being unsorted which at the very beginning…
-
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…
-
PYTHON
Python is a versatile, dynamic object-oriented programming language created by Guido Van Rossum and first released in 1991.Object-oriented programming (OOP) allows programmers to create there own objects that have attributes and methods making the code m…
-
PYTHON
Functions are reusable a block of codes performing a specific task, they make the program more effective and modular.While defining a function in Python, we also specify the parameters it can accept which we later pass as arguments in function call.Howev…
-
PYTHON
Lists are probably the most used data type in Python. Lists being mutable offer a lot of flexibility to perform a number of operations on the items of the list.A list contains items separated by commas and enclosed within square brackets [ ]. Lists in P…
-
PYTHON
In a nutshell, sorting is nothing but arranging data in a particular fashion. Selection sort is a popular sorting algorithm.In Selection sort, First and foremost the list is divided into two parts left part being the sorted which is initially empty and r…
-
PYTHON
One of Python’s built-in immutable sequence types is range(). This function is extensively used in loops to control the number of types loop have to run. In simple words range is used to generate a sequence between the given values.The range() function c…
-
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…