Found 34494 Articles for Programming

How to Alternate vowels and consonants in Python Strings?

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

119 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

131 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

617 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

532 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

143 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

427 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

208 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

Count of simple cycles in an undirected graph having N vertices

Pranavnath
Updated on 25-Aug-2023 15:47:19

165 Views

Introduction Undirected graphs are an essential component of computer science and graph theory, representing a group of nodes connected by edges without any directionality. One common problem associated with undirected graphs is the counting of simple cycles or circuits, which are closed paths that visit each vertex only once. In this article, we will explore how to get total count of the given undirected graph with N vertices using the powerful programming languages C and C++. Undirected Graph Before we jump into coding, let's ensure everyone grasps what constitutes a simple cycle within an undirected graph. Let us consider an ... Read More

DSatur Algorithm for Graph Coloring

Pranavnath
Updated on 25-Aug-2023 15:45:42

524 Views

Introduction Graph coloring may be an essential issue in graph hypothesis. The DSatur algorithm presents a compelling approach to play down the utilization of colors while performing chart coloring. By deliberately selecting vertices with the most noteworthy immersion degree, DSatur guarantees an optimized color task that maximizes color differing qualities and minimizes color utilization. In this article, we explore the DSatur calculation for chart coloring and its utilization utilizing C++. The calculation decides its title from the two key concepts it utilizes: Degree and Submersion. It considers the degrees of the vertices and their inundation degrees, which speak to the ... Read More

Advertisements