Category Archives: Python – len()

Python check length and size of string.

In this python article, We are going to learn python built-in functions len() and getsizeof(). len(): Using len() function we can check the length of an object(count number of items). In short len() function returns us the number of elements present in the sequence (List, Tuple, String, range) or in a mapping (Dictionary or set). getsizeof(): Using getsizeof() function we can check how much memory in bytes is allocated to store a complete object. Introduction to len() function: Basically len() function queries the container and returns

Read More