Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Frequency analysis: print the list of pairs (character, number of occurrences) found in a given string
- def fa(string):
- alp="abcdefghijklmnopqrstuvwxyz"
- for i in range(0, len(alp)):
- if string.count(alp[i]) >0:
- print('('+ alp[i]+','+ string.count(alp[i])+') ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement