Python list length

Here we will learn how to find python list length. Below we discussed the python list and find its length.

What is list in python?

A list is an ordered, mutable data structure in python. It can store mixed types of data.

elements are represented using square brackets [].

Example1 : Python list length on integers

A list of integers is created below and printed its length using len().

Example2 : Python list length of strings

A list of string is created and printed its length using len()

Example3 : Python list length of boolean values

list of boolean values True and False are created and printed its size using len().

Example3 : Python list length of mixed values

A mixed type of list is created with string, int, and other data types and its length is created using len().

Example4 : Python list length of Objects

A class student is created and its two objects s1 and s2 are created.

A list is created using two student objects and its length is printed using len.

Here student details are also printed using for loop.

Read More

Increment and decrement operators in Python (+=, -=)
Armstrong number in python: Algorithm, Program