Category: Python Programs

python tutorials and learn python

Created with Sketch.

Python program to print the largest element in an array

Python program to print the largest element in an array In this program, we need to find out the largest element present in the array and display it. This can be accomplished by looping through the array from start to end by comparing max with all the elements of an array. If any of element…
Read more

Python program to print the elements of an array present on odd position

Python Program: Print Elements at Odd Positions in an Array In this blog post, we will explore a Python program designed to print the elements of an array that are present at odd positions. The article will provide a comprehensive explanation of the algorithm used in the program, present the Python code for implementation, and…
Read more

Python program to print the elements of an array present on even position

Python Program: Print Elements at Even Positions in an Array In this blog post, we will delve into a Python program designed to print the elements of an array present at even positions. The article will walk through the algorithm used in the program, provide the Python code for implementation, and include examples with corresponding…
Read more

 Python program to print the elements of an array in reverse order

 Python program to print the elements of an array in reverse order In this program, we need to print the elements of the array in reverse order that is; the last element should be displayed first, followed by second last element and so on.       ALGORITHM: STEP 1: Declare and initialize an array.…
Read more

Python program to print the elements of an array

Python program to print the elements of an array This is a simple program to create an array and then to print it’s all elements. Now, just know about arrays. Arrays are the special variables that store multiple values under the same name in the contiguous memory allocation. Elements of the array can be accessed…
Read more

Python program to print the duplicate elements of an array

Python program to print the duplicate elements of an array In this program, we need to print the duplicate elements present in the array. This can be done through two loops. The first loop will select an element and the second loop will iteration through the array by comparing the selected element with other elements.…
Read more

Python program to left rotate the elements of an array

Python program to left rotate the elements of an array In this program, we need to rotate the elements of an array towards the left by the specified number of times. In the left rotation, each element of the array will be shifted to its left by one position and the first element of the…
Read more

Python program to find the frequency of each element in the array

Python program to find the frequency of each element in the array In this program, we have an array of elements to count the occurrence of its each element. One of the approaches to resolve this problem is to maintain one array to store the counts of each element of the array. Loop through the…
Read more

Python program to copy all elements of one array into another array

Python program to copy all elements of one array into another array In this program, we need to copy all the elements of one array into another. This can be accomplished by looping through the first array and store the elements of the first array into the second array at the corresponding position. ARRAY 1…
Read more

Python Program to Remove Punctuation from a String

Python Program to Remove Punctuation from a String Punctuation: The practice, action, or system of inserting points or other small marks into texts, in order to aid interpretation; division of text into sentences, clauses, etc., is called punctuation. -Wikipedia Punctuation are very powerful. They can change the entire meaning of a sentence. See this example:…
Read more