Found 34489 Articles for Programming

How to validate Indian Passport number using Regular Expression?

Naveen Singh
Updated on 31-Jul-2023 15:28:56

4K+ Views

An Indian passport number is special alphanumeric code that Indian government issues to owner of an Indian passport. The passport number is made up of 8–12 characters, that may include both letters and digits. The first two characters of passport number indicate type of passport, such as P for an ordinary passport, D for a diplomatic passport, and S for an official passport. The next two characters stand for the code of the organization that issues passports, and they are followed by string of numbers that serve as passport holder's special identification. Indian passport numbers are normally printed on the ... Read More

How to Generate a Random, Unique, Alphanumeric String in PHP

Naveen Singh
Updated on 28-Jul-2023 21:12:02

3K+ Views

What is PHP? PHP (Hypertext Preprocessor) is a popular scripting language designed for web development. It is widely used for creating dynamic and interactive web pages. PHP code can be embedded directly into HTML, allowing developers to mix PHP and HTML seamlessly. PHP can connect to databases, process form data, generate dynamic content, handle file uploads, interact with servers, and perform various server-side tasks. It supports a wide range of web development frameworks, such as Laravel, Symfony, and CodeIgniter, which provide additional tools and features for building web applications. PHP is an open-source language with a large community, extensive ... Read More

Check if a given string can be formed using characters of adjacent cells of a matrix

Naveen Singh
Updated on 31-Jul-2023 13:35:20

106 Views

Let's first understand the meaning of neighbour cells in matrices. To determine how each component fits into your two-dimensional matrix structure visualize each enclosed unit as being encompassed by almost eight adjacent elements positioned across/from them both diagonal directions in addition to vertical/horizontal ones. An example observation can be made about lattice size - the smallest circular enclosure in this design has nine components.(from left-to-right & up-to-down)Cell [row=9, col=8] -- within reach from [row=8, col=7], ...[row=10, col=8], and so forth. This intricate connection network links these adjacent components where they share edges or corners; creating a well-defined matrix structure stepping ... Read More

Python program to input a comma separated string

Naveen Singh
Updated on 28-Jul-2023 18:20:36

3K+ Views

When a text string is entered or given as input, it may have commas in between. Sometimes the task is to separate all the comma-separated portions of a sentence or a text string. These portions may have single word or multiple words. These string portions may be further entered as items of list or can be processed further. Similarly, numbers in integer form or decimal form are also needed to be entered while being separated by commas. In such cases, understanding these as numbers is important. By using four different examples, this process of given comma separated string or sentence, ... Read More

Python program to print all Strong numbers in given list

Naveen Singh
Updated on 08-Aug-2023 18:32:38

185 Views

A number is said to be a Strong number if the factorials of its individual digits are found and then added together and the total sum calculated is equal to the number itself. Here, in this Python article, using three different examples, the different methods of finding the Strong numbers if present in a list are given. In the Example 1, a list that contains the precalculated factorials of numbers are used for calculating the sum of factorials of all the present digits in a number while checking whether the selected number is strong or not. In example 2, the ... Read More

Python program to print all positive numbers in a range

Naveen Singh
Updated on 28-Jul-2023 18:13:28

399 Views

Sometimes the task is to select only the positive numbers from a given range. Here, in this Python article, first, the range is taken as input and then the negative as well as positive integers within this range are chosen. In this Python article, from these numbers only the positive numbers are then selected using the different methods in four different examples. In example 1, the positive numbers are picked and separated into another list. In the example 2, all the elements that are not positive are removed. In example 3, the sorted list is split up to zero and ... Read More

Python program to print all negative numbers in a range

Naveen Singh
Updated on 28-Jul-2023 18:10:20

255 Views

Sometimes the task is to select the negative numbers from a given range. Here, in this Python article, first, the range is taken as input and then the integers within this range are specified. From these numbers only the negative numbers are then selected using the different methods in 4 different examples. In example 1, the negative numbers are picked and separated into another list. In the example 2, all the elements that are not negative are removed. In example 3, the sorted list is split upto zero and only negatives are retained. In example 4, filter is used to ... Read More

How to check if URL Contain Certain String using PHP

Naveen Singh
Updated on 31-Jul-2023 11:40:45

3K+ Views

What is PHP? PHP (Hypertext Preprocessor) is a popular scripting language designed for web development. It is widely used for creating dynamic and interactive web pages. PHP code can be embedded directly into HTML, allowing developers to mix PHP and HTML seamlessly. PHP can connect to databases, process form data, generate dynamic content, handle file uploads, interact with servers, and perform various server-side tasks. It supports a wide range of web development frameworks, such as Laravel, Symfony, and CodeIgniter, which provide additional tools and features for building web applications. PHP is an open-source language with a large community, extensive documentation, ... Read More

Python program to find number of likes and dislikes?

Naveen Singh
Updated on 28-Jul-2023 18:04:00

473 Views

The ability to communicate our ideas, feelings, and preferences through likes and dislikes on social media platforms has revolutionized the way we connect with and interact with material. These straightforward yet effective indications are crucial for determining the level of interest and sentiment surrounding a post, video, or any other type of shared content. You could frequently get across situations as a Python programmer where you need to examine the number of likes and dislikes on a given article or video to learn more about user preferences or gauge engagement levels. We will study two distinct methods for determining the ... Read More

How to Make Boxplots with Data Points using Seaborn in Python?

Naveen Singh
Updated on 28-Jul-2023 18:01:55

640 Views

A strong visualization tool for summarizing a dataset's distribution is the boxplot. They provide important statistical parameters including the median, quartiles, and possible outliers. Traditional boxplots, on the other hand, simply provide summary statistics, thus they might not offer a complete picture of the data. In this article, we will learn how to make Boxplots with Data points using Seaborn in Python. A well-liked data visualization library based on matplotlib is called Seaborn. It offers a sophisticated interface for producing beautiful statistics visuals. We may create boxplots with overlapping data points using the functionality of Seaborn and Matplotlib, enabling ... Read More

Advertisements