You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
452 B
Python
14 lines
452 B
Python
5 years ago
|
def string_test(s):
|
||
|
d={"UPPER_CASE":0, "LOWER_CASE":0}
|
||
|
for c in s:
|
||
|
if c.isupper():
|
||
|
d["UPPER_CASE"]+=1
|
||
|
elif c.islower():
|
||
|
d["LOWER_CASE"]+=1
|
||
|
else:
|
||
|
pass
|
||
|
print ("Original String : ", s)
|
||
|
print ("No. of Upper case characters : ", d["UPPER_CASE"])
|
||
|
print ("No. of Lower case Characters : ", d["LOWER_CASE"])
|
||
|
|
||
|
string_test('The quick Brow Fox')
|