问问题
213 次
2 回答
1
Currently you are only checking whether the character is in a line at all, but not counting the occurences.
There's the count
method for doing what you want: https://docs.python.org/2/library/stdtypes.html#str.count
>> 'hello world'.count('l')
3
Also, as Wooble already pointed out in his comment, you must take special care when using non-ascii characters in python2 (he provided you with the needed information).
于 2014-05-25T12:12:15.783 回答
0
Try the open-tamil
library, which you can install from pip
:
$ pip install open-tamil
Here's how to use it:
import tamil
letters_list = tamil.utf8.get_tamil_letters( string_input )
于 2014-08-01T00:04:31.563 回答