There are many related questions to this, although they do not explain how to take words inputted by the user and use them in an equation. How would I do this?
Asked
Active
Viewed 95 times
-4
-
possible duplicate of [Is there a reason Python strings don't have a string length method?](http://stackoverflow.com/questions/237128/is-there-a-reason-python-strings-dont-have-a-string-length-method) – Celeo Nov 03 '14 at 22:08
-
1What have you tried? What questions have you looked at, and what part do you not understand? – abarnert Nov 03 '14 at 22:08
1 Answers
0
do you mean find the length of the string use len("string")
if you want to find the number of letters of a distinct type use counter
from collections import Counter
a = Counter("stringsss")
print a['s']

user3684792
- 2,542
- 2
- 18
- 23