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)
.
626 Uncaught (inpromise) Error on Electron: An object could not be cloned
585 PHP ssh2_scp_send fails to send files as intended
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.