Python Articles

Page 151 of 855

Python program to remove null value from a list

Utkarsha Nathani
Utkarsha Nathani
Updated on 27-Mar-2026 12K+ Views

This article discusses how to remove None values from a Python list. In Python, None represents the absence of a value and is equivalent to "null" in other programming languages. Understanding None in Python None is a keyword in Python that represents an empty or missing value. It is not the same as 0, False, or an empty string ? # None is unique print(None == 0) # False print(None == False) # False print(None == "") # False ...

Read More

Python Program To Search An Element In A List

Utkarsha Nathani
Utkarsha Nathani
Updated on 27-Mar-2026 10K+ Views

Python provides several methods to search for elements in a list. This is a fundamental operation when you need to check if a specific value exists or find its position within a collection of data. What is a List in Python? Lists are mutable data structures that store multiple items in a single variable. You can create a list using square brackets with elements separated by commas ? names = ["alice", "bob", "charlie"] numbers = [1, 2, 3, 4, 5] mixed = ["apple", 42, True, 3.14] print(names) ['alice', 'bob', 'charlie'] Using ...

Read More

Python Program To Check Two Set Are Equal

Utkarsha Nathani
Utkarsha Nathani
Updated on 27-Mar-2026 11K+ Views

Python sets are unordered collections of unique elements that are useful for mathematical operations. Checking if two sets are equal is a common task that can be accomplished using several methods. What Is A Set? A set is an unordered collection data type that is iterable, mutable and has no duplicate elements. Sets are represented by curly brackets {} and are highly optimized for checking whether a specific element is present. Sets are created by placing elements inside curly brackets, separated by commas, or by using the built-in set() function. Example # Simple set ...

Read More

Python Program to Remove a Subset from a List

Utkarsha Nathani
Utkarsha Nathani
Updated on 27-Mar-2026 5K+ Views

In Python programming, removing specific elements or subsets from a list is a common operation. Python provides several built-in methods like remove(), pop(), del, and clear() to handle different removal scenarios efficiently. What is a List in Python A list is a mutable, ordered data structure that can store multiple elements of different data types. Lists allow duplicate elements and support indexing, slicing, and various operations for adding or removing elements. # Creating a simple list numbers = [10, 20, 30, 40, 50] print("Original list:", numbers) # Lists can contain mixed data types mixed_list = ...

Read More

Python Program to Split a List into Two Halves

Utkarsha Nathani
Utkarsha Nathani
Updated on 27-Mar-2026 7K+ Views

In Python, lists are one of the most versatile data structures for storing collections of items. Sometimes you need to split a list into two equal or nearly equal parts for processing, analysis, or other operations. What is a List? Lists in Python are created using square brackets and can contain multiple data types including integers, strings, and objects. Since lists are mutable, you can modify them after creation, making them highly flexible for data manipulation. In this article, we will explore methods for dividing a list into two halves using Python programming. These techniques will help ...

Read More

Python Program to Get Minimum and Maximum from a List

Utkarsha Nathani
Utkarsha Nathani
Updated on 27-Mar-2026 11K+ Views

Python lists are mutable, ordered collections that can store multiple elements. Finding the minimum and maximum values from a list is a common operation with several approaches available. Finding Minimum Value from List Using min() Function The min() function returns the smallest element from a list or any iterable. It works with both numbers and strings ? numbers = [15, 58, 30, 97] minimum = min(numbers) print("The smallest element is:", minimum) The smallest element is: 15 For strings, min() returns the lexicographically smallest value ? names = ["alina", ...

Read More

How to Create a Pivot Table in Python using Pandas?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 4K+ Views

A pivot table is a powerful data analysis tool that allows you to summarize and aggregate data based on different dimensions. In Python, you can create pivot tables using the pandas library, which provides flexible and efficient tools for data manipulation and analysis. To create a pivot table in pandas, you first need to have a dataset in a pandas DataFrame. You can load data into a DataFrame from various sources such as CSV files, Excel spreadsheets, SQL databases, and more. Syntax Once you have your data in a DataFrame, you can use the pandas pivot_table() function ...

Read More

How to Create a Pie Chart in Seaborn?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 10K+ Views

A pie chart is a circular chart divided into slices to represent proportions of different categories in a dataset. While Seaborn doesn't have a direct pie chart function, we can combine Seaborn's color palettes with Matplotlib's pie() function to create visually appealing pie charts. Seaborn is a Python data visualization library built on top of Matplotlib that provides high-level statistical graphics with beautiful default themes and color palettes. Basic Pie Chart with Seaborn Colors Let's create a simple pie chart using Matplotlib's pie() function with Seaborn's color palette − import matplotlib.pyplot as plt import seaborn ...

Read More

How to create a meeting with the zoom API in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 3K+ Views

Zoom is a video conferencing platform that provides an API for developers to programmatically interact with its features. Python offers a simple way to create Zoom meetings through API calls using the requests library and JWT authentication. This guide demonstrates how to create a Zoom meeting using Python and the Zoom API. You can automate meeting creation and integrate it with other applications or workflows. Prerequisites and Setup To use the Zoom API, you must first create a Zoom app by following these steps: Go to https://marketplace.zoom.us/ and sign in to your Zoom account. Click ...

Read More

How to create a matrix of random integers in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 10K+ Views

In Python, you can create a matrix of random integers using the NumPy library. NumPy is a powerful library for scientific computing that provides support for multidimensional arrays and random number generation. To create a matrix of random integers, you use the numpy.random.randint() function. This function generates random integers within a specified range and returns a NumPy array of the specified shape. Syntax numpy.random.randint(low, high=None, size=None, dtype='l') Parameters low − The lowest (inclusive) integer to be generated in the matrix. high − The highest (exclusive) integer ...

Read More
Showing 1501–1510 of 8,549 articles
« Prev 1 149 150 151 152 153 855 Next »
Advertisements