compute character frequencies in Python strings -
i wondering if there way in python 3.5 check if string contains symbol. i'd know if there way check amount string contains. example, if want check how many times character '$' appears in string... ^$@%#$$, how that?
these built-in functions index , count. can find full documentation @ official site. please used doing research on own; first step familiar names of language elements.
if my_str.index('$') != 0: # found dollar sign print my_str.count('$')
Comments
Post a Comment