import collections
import string
with open('cipher.txt') as f:
f = f.read().replace(' ', '').replace('\n','').lower()
f = f.strip(string.punctuation)
cnt = collections.Counter(f.replace(' ', ''))
for letter in sorted(cnt):
print(letter, cnt[letter])
How do I strip the punctuation!! I can't figure out where to place that line? Can someone please modify my code to remove everything apart from letters? thank you