In this post, you will learn what is len fucnction and how does it work and also few examples on the line function will be taught by me and also below is the video format of the post do check it out ????????????
What is len function ❓
The len() function returns the number of items in the object field.
When the object is a string, the len() function returns the number of characters in the string.
In simple words I can if the string is “moulik” there are 6 letters so, the value returns will be 6.
How the len function works ????
Just take a look at the Gif I have given and you will understand how the len function works or still, you have any doubts then check the youtube video I made.
From the gif, we can understand that firstly the inner string get’s calculate and merges with the len function and display the length of the string and then print the output.
You can also enter your own value, for that, we need to enter the input function inside the len, it looks something like this ????????
So, this is how to insert input and len together and just try with your IDE or compiler.
Example on len() function
Just follow the below example and I am sure by end of this post you will be familiar with the len() function;
So, these are the examples I have got you can just try on your own and see ya in the next post ????
Also Read: Debugging in python
Also Read: Input function in python full tutorial