List

Convert a List of floats to List of integers in Python

This tutorial will discuss about unique ways to convert a list of floats to list of integers in Python. Table Of Contents Method 1: Using List Comprehension and int() Method 2: Using List Comprehension and round() Method 3: Using map() function Summary Method 1: Using List Comprehension and int() Iterate over all elements of List […]

Convert a List of floats to List of integers in Python Read More »

Convert a list of tuples to a list of lists in Python

This tutorial will discuss about unique ways to convert a list of tuples to a list of lists in Python. Table Of Contents Method 1: Using List Comprehension Method 2: Using map() function Method 3: Using enumerate() function Summary Method 1: Using List Comprehension Iterate over all the tuples in list using List Comprehension. During

Convert a list of tuples to a list of lists in Python Read More »

Convert all positive numbers to negative in Python List

This tutorial will discuss about unique ways to convert all positive numbers to negative in Python list. Table Of Contents Using List Comprehension Using map() function Using NumPy Array Summary Using List Comprehension Iterate over all numbers in Python List using a List comprehension. During iteration, for each number check if it is greater than

Convert all positive numbers to negative in Python List Read More »

Python List sort()

In this article, we will discuss about the usage details of sort() method of Python list. Table Of Contents Introduction Syntax of List sort() method Example 1: Using List sort() without any parameter Example 2: Using List sort() with reverse parameter Example 3: Using List sort() with key parameter Summary Introduction The sort() method of

Python List sort() Read More »

Scroll to Top