I have a code where I write a sentence, and then it makes a dictionary when the keys are the letters in the sentence and the values are the amount of times each letter appears in the sentence. The code counts spacebar as a letter, how can I prevent that?
sentence = input("write a sentence: ")
d=dict()
for n in sentence:
if n in d:
d[n]+=1
else:
d[n]=1
print(d)