Found 27104 Articles for Server Side Programming

Python – Alternate front – rear sum

Pranavnath
Updated on 25-Aug-2023 16:08:10

76 Views

One of the most important data types is List in the Python language. Various inbuilt methods to be available in python to manipulate the list items like append(), insert(), extend() and so on. Multiple approaches help in finding the alternate front-rear sum of an array. The array is given with n elements and the process involved are first element is added to the last element of the array, second element of an array is added to the second last element value and it continues until all the elements are added together. For example, let’s take the array, [40, 50, ... Read More

Check if the Left View of the given tree is sorted or not

Shubham Vora
Updated on 25-Aug-2023 15:53:45

68 Views

In this problem, we will check whether the left view of the binary tree is sorted. The left view of the binary tree means nodes we can see when we look at the binary tree from the left side. In simple terms, we can see only the first node of each level. So, we need to extract the value of the first node and check whether they are sorted to get the output. Problem Statement We have given a binary tree. We need to print whether the binary tree's left view is sorted. If it is sorted, print 'Yes'. ... Read More

Python – Check for float String

Pranavnath
Updated on 25-Aug-2023 16:06:02

387 Views

The strings consist of characters and to transform them into float data type, Python facilitates us with various methods using the inbuilt function. With the help of these inbuilt functions, we can check for the float strings easily. In this article, the user will learn how to check whether a string contains a float value. To achieve this, three strategies are demonstrated to verify float string. Isdigit() method is also used to check if the given string has only digits. Then the count() and replace() are used to check if the string contains decimal values and other characters of the ... Read More

Blackman in Python Numpy

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

152 Views

Introduction In signal processing and spectral analysis, window functions play a vital part in forming and modifying signals. The Blackman window is a commonly utilized window function in signal processing that makes a difference decrease spectral leakage effects. It is actualized in Python utilizing the effective NumPy library, which gives effective cluster operations and scientific capacities. In this article, we'll investigate three distinctive examples to execute the Blackman window in Python using the powerful NumPy library. Each approach will be went with by detailed calculations, step-by-step clarifications, of the Python syntax, and code cases with their respective outputs. Blackman ... Read More

How to Append suffix/prefix to strings in a Python list?

Pranavnath
Updated on 25-Aug-2023 15:55:21

1K+ Views

Introduction In this article, the users will understand how to append suffix/prefix to strings in a Python list. A List would store elements of different data types within these “[]” brackets. The string manipulation would be possible in the Python language. Various inbuilt string method are available in Python to append suffix/prefix to strings in a Python list like reduce(), map(), and so on. The two approaches are demonstrated in the article to append the specified character either in the starting or the rear side to the string. The methods to do this can be varying and some may be ... Read More

Python – Aggregate values by tuple keys

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

161 Views

Introduction 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. And the Python language plays a vital role in dealing with this data, as the data present can be relevant or irrelevant to each other. When they have some relevancy, it can be stored combinable with the other data or simply the aggregating of the data. In this, it combines the elements with similar characteristics and attributes they belong to. To do this process, ... Read More

Python – Check for descending Sorted list

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

718 Views

A List is a type of data structure in Python language that can store elements of different data types within these “[]” brackets. The order in which data can be sorted will be either ascending or descending. In a list when the preceding element is greater than the next element then it follows descending order and on the other hand, when the preceding element is less than the next element then it follows ascending order. Utilizing three distinct approaches, the ways are given verifying for descending Sorted list in python. Approaches Approach 1 − Using iteration method Approach 2 ... Read More

Python – Append K characters N times

Pranavnath
Updated on 25-Aug-2023 15:37:39

229 Views

Introduction In this article, the user will focus on how to Append K characters N times in python. In the Python Language, append() function is used to add a character to the existing list, but to add K characters in N number of times different approach is utilized. The first approach utilize the join() method, the second approach utilize the textwrap() method and the last approach utilize the reduce() method to add the character to the existing string. Append K characters N times The methods to do this can be varying and some may be simple loop iteration on the ... Read More

Python – All Possible N combination tuples

Pranavnath
Updated on 25-Aug-2023 15:34:17

303 Views

Introduction In Python, a tuple is one of the types of data structures. The tuples are composed of items or elements and look more like lists. It has elements which cannot be changed after declaration. To return all the possible combinations of the tuple primarily the itertool library is used. The iteration or repetition process through the tuples is done using the iterator object containing various items. For the purpose of returning all possible combinations in a tuple, we can use many functions like combination(), chain(), product() and concatenation method. All Possible N combination tuples Tuple is a data structure ... Read More

Character Encoding in Python

Pranavnath
Updated on 25-Aug-2023 14:54:04

197 Views

Introduction Python has got a remarkable place in the field of handling data with the technologies like data science and machine learning. 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. In the Python language, Unicode is used and is represented as UTF (Universal Coded Character Set plus Transfer Format)-8. To encode the characters, there are two main possibilities of characters one is an ASCII character and the other is a non-ASCII ... Read More

Advertisements