Articles on Trending Technologies

Technical articles with clear explanations and examples

Tutorix - AI Tutor

What is Seaborn and why should we use seaborn?

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 438 Views

Seaborn is a powerful Python data visualization library built on top of Matplotlib. It provides a high-level interface for creating attractive and informative statistical graphics, making it easier to explore and understand data patterns. What is Seaborn? Seaborn is an open-source Python library designed specifically for statistical data visualization. It integrates seamlessly with pandas DataFrames and NumPy arrays, offering beautiful default styles and color palettes that make your plots publication-ready with minimal code. Key Features Built-in statistical plotting functions Beautiful default themes and color palettes Seamless integration with pandas DataFrames High-level interface for complex visualizations ...

Read More

Python Program to Check Overlapping Prefix - Suffix in Two Lists

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 529 Views

Generally, a prefix is a sequence of characters that appear at the beginning of a string or list, and a suffix is a sequence of characters that appear at the end of a string or list. For example, when we consider the list [1, 2, 3, 4, 5], a prefix could be [1, 2, 3] and a suffix could be [3, 4, 5]. Notice how they overlap at element 3. Checking for overlapping prefixes and suffixes in two lists involves comparing elements to determine if the end of one list matches the beginning of another list. This concept ...

Read More

Python program to check if the given string is IPv4 or IPv6 or Invalid

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 2K+ Views

An IP address is the short form of Internet Protocol address, which is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves as an identifier for the device, allowing it to send and receive data over the network. IPv4 (Internet Protocol version 4): This is the most widely used version of IP addresses. It consists of four sets of numbers separated by periods, such as "192.168.0.1". Each set can have a value between 0 and 255. IPv6 (Internet Protocol version 6): This is the newer version ...

Read More

Python Program to check if elements to the left and right of the pivot are smaller or greater respectively

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 220 Views

In Python, a pivot is an element used to partition data into two groups: elements smaller than the pivot on the left, and elements greater than the pivot on the right. This concept is commonly used in sorting algorithms like quicksort. Let's explore different methods to check if elements to the left of a pivot are smaller and elements to the right are greater than the pivot value. Using Loops We can iterate through the array using loops to check each element against the pivot value ? def check_pivot_with_loops(arr, pivot_index): pivot ...

Read More

Python Program to check date in date range

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 3K+ Views

In this article we will learn how to check if a given input date falls within a specified date range. Python provides several approaches to accomplish this task, each with its own advantages. Using the datetime() Function The datetime module offers classes to manipulate dates and times. The datetime() function accepts year, month, and day as input arguments and returns a datetime object that can be easily compared. Example In this example we check if the date 25−05−2023 falls within the range of 01−01−1991 to 31−12−2023 ? from datetime import datetime def is_date_in_range(date, ...

Read More

Python program to Check all strings are mutually disjoint

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 248 Views

String is one of the data structures which holds data enclosed in double quotes or single quotes. It is immutable, meaning once we define the data we cannot change or modify it. In Python we have a function called str() which takes any data as input and returns the string as output. Mutually disjoint means no two strings have any common characters. There are different ways to check if all strings are mutually disjoint. Let's explore each approach. Using Nested Loops This approach uses nested loops to compare each pair of strings by converting them to sets ...

Read More

Python program to change the value of a dictionary if it equals K

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 210 Views

A dictionary is one of Python's most versatile data structures, storing data in key-value pairs using {} curly braces. Dictionary keys are unique, values can be repeated, and the structure is mutable, allowing modifications after creation. In this article, we'll explore different techniques to change dictionary values that equal a specific value K. Let's examine each approach with practical examples. Using a For Loop The for loop iterates through dictionary items and updates values when they match our target value K ? Example def change_value_if_equals_K(dictionary, K, new_value): for key, value ...

Read More

Python program to calculate gross pay

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 722 Views

Gross pay is the total amount paid to an employee before taxes and deductions. It includes base salary, bonuses, overtime, and reimbursements. The basic formula is: Hours worked × Pay per hour = Gross pay For example, if an employee worked 40 hours at ₹500 per hour: 40 × 500 = ₹20, 000 gross pay Let's explore different methods to calculate gross pay using Python. Basic Gross Pay Calculation The simplest approach calculates gross pay using hours worked and hourly rate ? def calculate_gross_pay(hours, hourly_rate): ...

Read More

Python program to calculate square of a given number

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 2K+ Views

A square is defined as the multiplication of a number by itself. The square of a number n is given as n2. Mathematically, we can represent the square of a number as: n² = n × n Python provides several approaches to calculate the square of a number. Let's explore the most common methods. Using Exponential Operator (**) The exponential operator (**) performs exponent arithmetic operations. To find the square, we raise the number to the power of 2. Syntax: n ** 2 Example Here we calculate the square of 25 using the ...

Read More

Python program to calculate Date, Month and Year from Seconds

Niharika Aitam
Niharika Aitam
Updated on 27-Mar-2026 1K+ Views

When working with timestamps, you often need to convert seconds (Unix epoch time) into readable date components. Python provides several approaches using the datetime module, time module, or manual calculations with divmod(). Using datetime Module The datetime module offers classes to manipulate dates and times. The utcfromtimestamp() function converts seconds since epoch (January 1, 1970) into a datetime object. Syntax datetime.datetime.utcfromtimestamp(seconds) Example Here we convert 1706472809 seconds to extract the day, month, and year components ? import datetime def calculate_date(seconds): date = datetime.datetime.utcfromtimestamp(seconds) ...

Read More
Showing 191–200 of 61,297 articles
« Prev 1 18 19 20 21 22 6130 Next »
Advertisements