Simple python program to find the length of a list. In this program, we can find the length of a list in python programming language for beginners.
Length Function in Python
The length of a list, string, dictionary, or any other iterable data format in Python is returned by the len() Python method. The len() method in Python is a built-in function for calculating the length of any iterable object. Here we can calculate length() to execute python program to find the length of a list
List Definition in Python
In Python, a list is an ordered sequence of mutable elements that can be changed. An item is the name given to each element or value found within a list. Lists are defined by values enclosed in square brackets [] in the same way that strings are defined by characters enclosed in quotes.
Python Program to Find the Length of a List
list = [ 10, 40, 50, 76, 83 ]
print ("List is" + str(list))
counter = 0
for i in list:
counter = counter + 1
print ("Length of List " + str(counter))
Output:
List is[10, 40, 50, 76, 83]
Length of List 5
Python Program to Check Perfect Number Using While Loop
C++ Program to Print an Integer
C++ Program to Add Two Numbers
C++ Program to Swap Two Numbers Using Temp Variable
C++ Program to Check Vowel or Consonant Using If Else
C++ Program to Find Grade of a Student Using If Else
C++ Program to Count Number of Characters Words and Lines in a File
C++ Program to Find Transpose of a Matrix
Learn To Code From Scratch For Beginners
Python Program to Find Odd or Even Using If Else
Python Program to Add Two Numbers With User Input
Swapping of Two Numbers in Python Without Temporary Variable