How To Find The Range Of A List In Python

Python provides many ways to manipulate and extract information from lists. In this tutorial, we will learn how to find the range of a list in Python. We will show you how to do this using built-in functions and simple code snippets.

Steps:

1. Call the built-in max() function and pass the list as an argument. This returns the maximum value in the list.

2. Call the built-in min() function and pass the list as an argument. This returns the minimum value in the list.

3. Subtract the minimum value from the maximum value. This will give you the range of the list.

Output:

Range of the list is: 40

Conclusion:

In this tutorial, we have learned how to find the range of a list in Python using simple code snippets and built-in functions. By using these methods, you can easily extract information from lists and use them in your programs.