Found 26504 Articles for Server Side Programming

Check if a Word is Present in a Sentence

Tapas Kumar Ghosh
Updated on 17-Aug-2023 18:05:20

1K+ Views

A sentence is a group of words that are present in a string. In this problem statement, we need to set a specific word and check whether the word is present in a given string or not. In C++, we have some pre-defined functions such as find(), npos(), and istringstream() will be used to Check if a word is present in a sentence. Using Standard library Function The program uses a standard library function that allows the programmer to use pre-existing functions of the C compiler such as find() and npos() to perform certain tasks. Syntax The following syntax is ... Read More

Check if a number with even number of digits is palindrome or not

Tapas Kumar Ghosh
Updated on 17-Aug-2023 18:02:54

377 Views

The palindrome refers to same number when the digits are reversed. In this program, we need to set the condition and operation based on an even number of digits to identify whether the given input satisfied for palindrome or not. In C++, we have STL(Standard template library) functions such as to_string(), length(), rbegin(), rend(), and, push_back() will be used to Check if a number with an even number of digits is palindrome or not. For example- 2662, 42124, 44, 888, etc are satisfied for even digit palindrome numbers. Using for loop and if-else statement The program uses for loop to ... Read More

Python - K List Dictionary Mesh

Tapas Kumar Ghosh
Updated on 17-Aug-2023 17:58:41

165 Views

The term dictionary Mesh is defined by storing the value pair of every key set to dictionary. To include the K list in the dictionary means to insert the list as value pair. In Python, we have some built-in functions such as defaultdict() and lambda will be used to solve the K list dictionary Mesh. Let’s take an example of this. Given input list, list1 = [10, 20, 30] list2 = [40, 50] The final output becomes: {10: {40: [], 50: []}, 20: {40: [], 50: []}, 30: {40: [], 50: []}} Syntax The following syntax is used ... Read More

Python Tensorflow - tf.keras.Conv2D() Function

Parth Shukla
Updated on 17-Aug-2023 16:40:23

759 Views

Introduction In deep learning, computer vision is one of the most important fields which is used for many complex and advanced tasks related to image datasets. It is used for image analysis, object detection, segmentations, etc. This is mainly achieved with the combination of TensorFlow and Keras, which offers several inbuilt functions which automate and make the process of model training very easy. The Conv2D is also one of the most useful and powerful functions in the Keras library, which is used for applying convolutional operations to the image. In this article, we will discuss the Conv2D function ... Read More

Compute Classification Report and Confusion Matrics in Python

Parth Shukla
Updated on 17-Aug-2023 16:31:25

913 Views

Introduction In machine learning, classification problems are one of the most widely seen problems, where machine learning models are built to classify several categories of the target variables. However, the classification report and confusion matrics are used in order to evaluate the performance of the model and to check where the model is making mistakes. In this article, we will discuss the classification report and confusion matrics, what they are, how we can use them, and what their interpretation is by calculating the same code examples in Python. This article will help one to clear an idea about ... Read More

Python - K Elements Reversed Slice

Tapas Kumar Ghosh
Updated on 16-Aug-2023 16:11:56

245 Views

The reverse slice is defined by creating a slice that begins with the length of the string and ends with the 0th index. For reversing the list element it will use the negative value notation, where we can get a reversed order of the original list element. In Python, we have some built-in functions such as append(), len(), and, range() will be used to solve the K elements Reversed Slice. Syntax The following syntax is used in the examples- append() This built-in method in Python can be used to add the element at the end of the list. len() ... Read More

How to set up pygame with Eclipse?

Tapas Kumar Ghosh
Updated on 27-Feb-2025 17:36:56

353 Views

The pygame is the name of the module of Python that helps to build the code for graphics such as rectangles, squares, circles, etc. It is also used the write the code for animation programs in Python. Eclipse is famous for Java IDE but here we have to set the environment of Python to run the program based on Pygame. System requirement Memory: 4 GB CPU: Intel Core ... Read More

Python - Filter unequal elements of two lists corresponding same index

Tapas Kumar Ghosh
Updated on 16-Aug-2023 16:20:05

558 Views

The indexing is the specific position of the element from the list. The unequal elements of two lists refer to those indexes whose elements are not matched from both lists. In Python, we have some built-in functions like enumerate(), zip(), filter(), etc. that can be used to filter unequal elements of two lists corresponding same index. Let’s take an example of this Given list, lst_1 = [10, 20, 30, 40, 50] lst_2 = [1, 20, 3, 40, 50] Then the final result becomes [20, 40, 50] these elements from the list matches the corresponding same index. Syntax The following syntax ... Read More

Finding Words with both Alphabet and Numbers using Python

Tapas Kumar Ghosh
Updated on 16-Aug-2023 16:09:25

718 Views

Python refers to the high-level programming language that has various tools and built-in functions to analyze text data. This problem statement is a common task that uses some built-in functions- filter(), isdigit(), isalpha(), findall(), split(), and, append() to find the both alphabet and numbers using Python. Let’s see how to take the input of the program to get the result: Input my_text = "WELCOME TO CLUB100" Output CLUB100 Syntax The following syntax is used in the examples- filter() The filter() method is applied when it filter the items based on specific conditions. In simple terms, it allows ... Read More

Python - Find first Element by Second in Tuple List

Tapas Kumar Ghosh
Updated on 16-Aug-2023 16:07:16

569 Views

The tuple list defines the two different datatypes of Python that represent the static and dynamic characteristics respectively. In a dictionary, we can create keys using tuples whereas lists cannot be used as keys. In Python, we have some built-in functions like next(), items(), index(), lambda, and, min() will be used to Find the first element by the second in the tuple list. This type of circumstance occurs when the second element holds the important information as a key for identifying the desired tuple. Let’s take an example of this: The given tuple list, my_tup = [("India", 35), ("Indonesia", 12), ... Read More

Advertisements