How to Determine the Size of a Word in Python
- 1). Use the syntax "targetWord = 'word'" where "word" is the word whose length you are determining and "targetWord" is the name you are giving to the string that will hold the word.
- 2). Use the syntax "wordLength = len(targetWord)" where "wordLength" is the name you are giving the integer variable that will hold the number that corresponds to the length of the word.
- 3). Use the syntax "print wordLength" to display the size of your word.
Source...