xxxxxxxxxx
my_list = [1,2,3,4,5,6,7,8,9,10]
length_of_list = len(my_list)
xxxxxxxxxx
# example of len() function
list_number = [6, 3, 8, 0]
length = len(list_number)
print("The lentgh of the list is: " + str(length))
xxxxxxxxxx
studentGrades = [9.1, 8.8, 10.0, 7.7, 6.8, 8.0, 10.0, 8.1, 10.0, 9.9]
print(len(studentGrades))
xxxxxxxxxx
# Creating a List
List1 = []
print(len(List1))
# Creating a List of mixed values
List2 = ["Softhunt", ".net", 14]
print(len(List2))
# Creating a List of numbers
List3 = [10, 20, 14, 31, 3]
print(len(List3))
xxxxxxxxxx
list_1 = ["Hello", 1, "World", 2]
# if you want length of this lins use len() function
print(len(list_1))
# if you want size in bytes
import sys
print(sys.getsizeof(list_1), "Bytes")
xxxxxxxxxx
#a list
cars = ['Ford', 'Volvo', 'BMW', 'Tesla']
#some updates on list
cars.append('Honda')
cars.append('Tata')
#find length of list
length = len(cars)
print('Length of the list is :', length)
6
xxxxxxxxxx
# plz suscribe to my youtube channel -->
# https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A
#get length of list
list_example = ["python","ruby","java","javascript","c#","css","html"]
print(len(list_example))