‘len(s)’ function is used to get the length of the object. Here the argument ‘s’ can be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set).
len_list.py
primes=[2, 3, 5, 7, 11, 13, 17, 19, 23]
print('len(primes) : ', len(primes))
Output
len(primes) : 9
No comments:
Post a Comment