- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountStr.py
More file actions
Latest commit
27 lines (27 loc) · 795 Bytes
/
Copy pathCountStr.py
File metadata and controls
27 lines (27 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
string=input("Enter the string: ")
alphabet=digit=special_character=word=lowercase=uppercase=vowel=space=0
vowels="AEIOUaeiou"
forchinstring:
ifch.isalpha():
alphabet+=1
ifchinvowels:
vowel+=1
ifch.islower():
lowercase+=1
else:
uppercase+=1
elifch.isdigit():
digit+=1
elifch.isspace():
space+=1
word+=1
else:
special_character+=1
print("Total Alphabets:", alphabet)
print("Total Digits:", digit)
print("Total Uppercase letters:", uppercase)
print("Total Lowercase letters:", lowercase)
print("Total Space:", space)
print("Total Vowels:", vowel)
print("Total Special Characters:", special_character)
print("Total Words:", (word+1))