0
Average word length
Please tell how to remove symbols from the sentence x = str(input()) txt = len(x.strip()) word = len(x.split()) print(round(txt//word))
1 Answer
+ 1
Many ways..
Simple one, Hint:
isalpha() returns true if str is an alphabet otherwise false.
Ex: str.isalpha()
print('a'.isalpha() ) #True
str.isalpnum()
returns true if str is a alphabet or numeric value..
print('1'.isalnum()) #True
also isdigit() used to check is it digit or not.
isnum() used to check is it number or not. .
Symbols are not alphabets, not numbers...