Found 27104 Articles for Server Side Programming

Python – Bitwise OR among list elements

Pranavnath
Updated on 25-Aug-2023 14:38:11

219 Views

Introduction Python Language comes under the OOPS concept and it runs the code immediately without checking for errors. This language was discovered by Guido Rossum in 1989 and was globally launched in the year 1991. Python is a versatile and high-level language that can be understood easily by the user. In the current world, handling data is the most challenging task for organizations with a high volume of data and with the development of data science and machine learning it has become easier to access. Bitwise OR among list elements The Operator used for representing the bitwise operator is “|”. ... Read More

How to Alternate vowels and consonants in Python Strings?

Pranavnath
Updated on 25-Aug-2023 14:12:24

115 Views

The words are composed of vowels and consonants that form the strings. Using the Python language, the vowels and consonants can be varied inside the string. The methods to do this can be varying and some may be simple loop iteration on the other side it can be some of the functions and methods. In this article, the user will learn how to alternate vowels and consonants in Python Strings. Three approaches are depicted in this article. Multiple inbuilt functions are available in the python language to resolve the complex problem. Let’s take a deep dive into this article. ApproachApproach ... Read More

Python – Alternate Character Addition

Pranavnath
Updated on 25-Aug-2023 14:06:53

127 Views

Introduction Python Language comes under the OOPS concept and it runs the code immediately without checking for errors. Apart from the other languages it has got its unique place because of its advantages like it’s easy to code with simple syntax and statements. Strings are composed of characters and character addition is one of the string manipulation techniques used to alter the characters in the strings. Then append those altered characters together to form a new string. Alternate Character Addition Approach Approach 1 − Using the recursive function. Approach 2 − Using for loop. Approach 3 − ... Read More

How to Convert a Python String to Alternate Cases?

Pranavnath
Updated on 25-Aug-2023 14:01:21

587 Views

In this article, the user will learn how to convert a Python string to alternate cases. The strings are comprised of characters and it is indicated either within single quotes or double quotes. The string can be converted into alternate cases using the Python language. In the given string, the strings can be converted from uppercase to lowercase or vice versa. The three approaches are demonstrated in this article. The first approach describe the concept of for loop, the second approach uses the join() method and the three approach uses the regular expression to convert a Python string to Alternate ... Read More

Categorizing input data in Python lists

Pranavnath
Updated on 25-Aug-2023 13:59:07

509 Views

Introduction A List is a type of data structure in Python language that can store elements of different data types within these “[]” brackets. The given data are listed according to the data type like integer and string. There are three primary functions involved namely filtering, sorting, and grouping. To sort lists based on certain conditions such as alphabetical order or ascending or descending numerical value we can use sorted() which takes two parameters the object to be sorted and the key parameter for the sorting technique. Categorizing input data in Python lists The empty list can also be initialized ... Read More

Python – Alternate rear iteration

Pranavnath
Updated on 25-Aug-2023 13:53:33

134 Views

Introduction Implementing alternate rear iteration using Python involves basic usage of list data structure and functionality with the help of looping structures. This problem applies simple mathematical skills that allow us to determine even numbers to print the alternate number from the back side. The data structures available in the Python language are lists, tuples, and dictionaries. It provides the users with the facility of iterating through the different types of data structures. Most commonly, the for loop is used to iterate through the lists or tuples. Alternate rear iteration In this article, the iteration is followed from the back ... Read More

How to Find the average of two list using Python?

Pranavnath
Updated on 25-Aug-2023 13:39:03

410 Views

Introduction Python is popular worldwide because of its simplicity and flexibility with other applications. In the 21st century, handling data is the most challenging task for organizations with a high volume of data, and with the development of data science and machine learning it has become easier to access. The List is a data structure consisting of changeable elements after the initialization. The lists are usually assigned a value within a brackets “[]” in some ordered form. To Find the average of two lists using Python In this article, we will explore various techniques for finding the average of ... Read More

Finding the Cartesian product of strings using Python

Pranavnath
Updated on 25-Aug-2023 13:36:14

203 Views

In this article, the user will learn how to find the cartesian product of a string using Python. String manipulation is possible using Python language. The wide varieties of inbuilt functions and operators are available in Python to perform certain operations on the string. The Python language is an eminent one and is primarily used in developing the applications for the specific need of the user. In this article, various methods used to find the Cartesian product of the given strings is found. The Cartesian product is used in Python language to get all possible combinations of the given string. ... Read More

Finding All Occurrences of a substring in a Python string

Pranavnath
Updated on 25-Aug-2023 13:34:30

3K+ Views

The strings are composed of characters and initialized in the code using simple or double quotes and substring is also a character present inside a string. Python is a versatile and high-level language that can be understood easily by the user. In this article, all the occurrences of the substring are found in a string using Python language can be done with various methods. Some common methods are index() method, in the operator, find() method, and use a regular expression method. Finding All Occurrences of a substring in a Python string The substrings are the characters of a string and ... Read More

Python3 Program for Longest subsequence of a number having same left and right rotation

Shubham Vora
Updated on 25-Aug-2023 17:02:30

59 Views

In this problem, we will find the length of the longest subsequence of the given string such that it has the same left and right rotation. We can solve the problem by finding all subsequences of the given string and checking whether particular subsequences have the same left and right rotation. The other approach uses the observation that string can have only the same left and right rotation if it contains a single character or alternate character and the left is even. Problem statement – We have given an alpha string containing only numeric digits. We need to find ... Read More

Advertisements