Given a string needs to count the characters except number,small letters,ipper letters and spaces?
Eg i/p- ancSddhk#adjdl
O/p-3
1
Expert's answer
2021-08-23T13:39:35-0400
inputString=input("Enter string: ")
characters =0
for l in inputString:
if not l.isupper()and not l.islower() and not l.isdigit() and l!=' ':
characters+= 1
print(f'Special characters: {characters}')
Comments
Leave a comment