My Blog

My WordPress Blog

My Blog

My WordPress Blog

Python

Tuples

Tuple is one of the built-in data types in Python. A Python tuple is a sequence of comma separated items, enclosed in parentheses (). The items in a Python tuple need not be of same data type. Following are some examples of Python tuples − The empty tuple is written as two parentheses containing nothing […]

List Exercises

Python List Exercise 1 Python program to find unique numbers in a given list. Open Compiler It will produce the following output − Python List Exercise 2 Python program to find sum of all numbers in a list. Open Compiler It will produce the following output − Learn Python in-depth with real-world projects through our Python certification course. Enroll and become a […]

List Methods

List is one of the fundamental data structures in Python, It provides a flexible way to store and manage a collection of items. It has several built-in methods that allow you to add, update, and delete items efficiently. Lists in Python can contain items of different data types, including other lists, making them highly flexible […]

 Join Lists

Join Lists in Python Joining lists in Python refers to combining the elements of multiple lists into a single list. This can be achieved using various methods, such as concatenation, list comprehension, or using built-in functions like extend() or + operator. Joining lists does not modify the original lists but creates a new list containing the combined elements. […]

Copy Lists

Copying a List in Python Copying a list in Python refers to creating a new list that contains the same elements as the original list. There are different methods for copying a list, including, using slice notation, the list() function, and using the copy() method. Each method behaves differently in terms of whether it creates […]

 Sort Lists

Sorting Lists in Python Sorting a list in Python is a way to arrange the elements of the list in either ascending or descending order based on a defined criterion, such as numerical or lexicographical order. This can be achieved using the built-in sorted() function or by calling the sort() method on the list itself, […]

Loop Lists

Loop Through List Items Looping through list items in Python refers to iterating over each element within a list. We do so to perform the desired operations on each item. These operations include list modification, conditional operations, string manipulation, data analysis, etc. Python provides various methods for looping through list items, with the most common being the for […]

Scroll to top