Question #5991
Submitted by Answiki
on 03/01/2022 at 08:08:36 PM UTC
How to get the length of a string in Python?
Merged questions
Answer
Submitted by Answiki
on 03/01/2022 at 08:11:02 PM UTC
In Python, the len() function returns the number of characters in a string. For example:
>>> string = "Hello world";
>>> print ("Number of characters : ", len(string))
Number of characters : 11
Answer by Answiki on 03/01/2022 at 08:11:02 PM
In Python, the len() function returns the number of characters in a string. For example:
>>> string = "Hello world";
>>> print ("Number of characters : ", len(string))
Number of characters : 11
Question by Answiki 03/01/2022 at 08:08:36 PM
How to get the length of a string in Python?
Question by Answiki 03/01/2022 at 08:08:01 PM
In Python, how to know the number of characters in a string?
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 13435 | alphons | https://en.ans.wiki/5991/how-to-get-the-length-of-a-string-in-python | 1 |
| 1 | 12691 | en | https://en.ans.wiki/5991/how-to-get-the-length-of-a-string-in-python | 9 |
Icons proudly provided by Friconix.