how to get the length of a string in python stack overflow

string = "Hello World"
len(string) # number of characters in string

Here is what the above code is Doing:
1. We create a variable called string and set it equal to “Hello World”.
2. We use the len() function to get the length of the string.
3. We print the length of the string to the console.