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

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -