You shouldn't be setting x = []
. That is setting an empty list to your inputted parameter. Furthermore, use python's for i in x
syntax as follows:
for i in x:
if i.isalpha():
letters+=1
elif i.isnumeric():
digit+=1
elif i.isspace():
space+=1
else:
other+=1