Found 26504 Articles for Server Side Programming

How to Unzip a list of Python Tuples

Aayush Shukla
Updated on 01-Aug-2023 11:59:49

606 Views

Python is a programming language used world wide for different purposes such as web development, data science, machine learning and to perform many different processes with automation. Tuple is a very useful feature of python which helps to stores data from multiple data sets like dictionary, list etc. together on one level. In this article we learn about the different methods that can be used to unzip a list of python tuples. Different Methods to Unzip a List of Python Tuples List Comprehension List comprehension is used to check over each element present in the list one by one. In ... Read More

How to Remove Square Brackets from a List using Python

Aayush Shukla
Updated on 01-Aug-2023 11:47:30

15K+ Views

Python is a very useful software which can be used for many different purposes as per need. The different process for which python can be used are web development, data science, machine learning, and at many other different places where process is to be performed with automation. It has many different features which help us to perform these tasks. One such useful feature of python is python lists. As the name suggest, list contains all the data that you wish to store. It is basically a collection of different types of information. Different Methods to Remove Square Brackets Many−a−times, ... Read More

Repeated Character Whose First Appearance is Leftmost

Sonal Meenu Singh
Updated on 01-Aug-2023 09:41:45

217 Views

Introduction In this tutorial, we will develop an approach to finding repeated characters in a string whose first appearance is leftmost. This means the character first appeared at the beginning of the string. To find out whether the first character repeats or not, we traverse the whole string and match each character to the first character of the string. To resolve the task we use the find(), length(), and end() functions of the C++ programming language. Example 1 String = “Tutorialspoint” Output = The repeating character is “t” In the above example, the leftmost character of the input ... Read More

Queries to check if string B exists as a substring in string A

Sonal Meenu Singh
Updated on 01-Aug-2023 09:38:52

298 Views

Introduction In this tutorial, we will see queries to check if string B exists as a substring of string A. A substring is a string that is part of the main string. In the Query array, there are some integer values, and the index of string A will be checked to see if those integer values match the substring B or not.We use C++ queries to find out whether B is a substring of A or not.In this approach, there is a string A and B is the substring of A. Queries in C++ are integer values represented in array ... Read More

Find the sum of the ascii values of characters which are present at prime positions

Sonal Meenu Singh
Updated on 01-Aug-2023 09:34:50

561 Views

Introduction In this tutorial, we will learn the concept of c++ to find the sum of ASCII values of the characters present in the prime position. Prime position means characters whose position is 2, 3, 5, or any other prime number. ASCII (American Standard Code for Information Interchange) values are unique numerical values for alphabets, letters, punctuation marks, and other characters used in coding. It is used for communication with computers as the computer does not understand human language. There are 128 ASCII values starting from 0 to 127. Capital and small alphabets have separate ASCII values. We will develop ... Read More

Find max length odd parity substring

Sonal Meenu Singh
Updated on 31-Jul-2023 20:02:40

156 Views

Introduction In this tutorial, we develop an approach to finding the maximum length odd parity substring. Odd parity in a substring means the number of times 1 repeats in a string is odd. Parity in C++ defines the bit set number and is 1s in a number. There are two types of parity: even and odd. When the total number of “1” in a binary representation is odd it is known as an odd parity string. In this tutorial, we find the maximum length odd parity substring using C++ programming concepts. Implementation 1 String = 101100 Output = 6 ... Read More

Distinct palindromic sub-strings of the given string using Dynamic Programming

Sonal Meenu Singh
Updated on 31-Jul-2023 19:57:39

583 Views

Introduction In this tutorial, we discuss an approach to finding all possible palindrome substrings using the input string. To implement the approach for this task we use C++ programming language and its functions. A palindrome is a string that reads the same from the back and front. For example, Mom is a palindrome string. In this tutorial, we take a string and find all possible palindrome substrings from it. Example 1 String = abcaa Output The possible palindromic substrings are : a, b, c, aa, aaa, aba, and aca. In the above example, the input string can make ... Read More

How to conduct Grid search using python?

Jay Singh
Updated on 31-Jul-2023 19:02:10

232 Views

Optimizing hyper parameters in machine learning models requires the use of grid search. Model performance is greatly influenced by hyper parameters like regularization strength or learning rate. With grid search, a preset set of hyper parameters is methodically investigated to identify the configuration that produces the best outcomes. Grid search offers an easy-to-use interface for building a grid of hyper parameters and evaluating model performance via cross-validation, both of which can be done using Python's Scikit-learn module. Grid search automates the search for ideal hyper parameters, allowing machine learning practitioners to concentrate on crucial activities like feature engineering and model ... Read More

Count pairs of characters in a string whose ASCII value difference is K

Sonal Meenu Singh
Updated on 31-Jul-2023 19:50:15

165 Views

In this tutorial, we learn how to count the character pair in a string whose ASCII value is the difference of K. K is any difference value, it can be either 1 or 0. Create a C++ code to count such character pairs in an input string S. We used the size() method of the String class Syntax size() = It is a String class method. It is an empty parameter library method. It returns the size of the string in terms of bytes. string_name.size() Example = s.size() ASCII values are predefined values for characters, symbols, ... Read More

Count of three non-overlapping substrings which on concatenation forms a palindrome

Sonal Meenu Singh
Updated on 31-Jul-2023 19:48:53

144 Views

Introduction In this tutorial, we will elaborate an approach for finding three non-overlapping substrings from a given string s, and when all substrings are combined together they form a palindrome. To solve this task we use the string class features of the C++ programming language. Palindrome in a string means the string reads the same in both forward and backward directions. The palindrome string example is Madam. Suppose there is a string "s" and the substrings are a, b, and c. When you combine a, b, and c, they form a palindrome string. Here is an example to understand the ... Read More

Advertisements