n = input('Enter string:')
n = n.lower()
n = n.replace(' ','')
n = n.replace('',' ')
n = n.strip()
L = n.split(' ')
S = set(L)
X = list(S)
k = len(X)
def moonchk(n) :
for i in range(0,k):
a = X[i]
print(a, ':', L.count(a))
return ''
print(moonchk(n))
Enter string: THANKS, thanks!!! ! : 3 k : 2 n : 2 t : 2 h : 2 s : 2 a : 2 , : 1 None
How can I get rid of none?
python def none
I think you can fix print(moonchk(n))
to moonchk(n)
.
© 2025 OneMinuteCode. All rights reserved.