- Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathq13.py
22 lines (18 loc) · 542 Bytes
/
q13.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Question:
# Write a program that accepts a sentence and calculate the number of upper case letters and lower case letters.
# Suppose the following input is supplied to the program:
# Hello world!
# Then, the output should be:
# UPPER CASE 1
# LOWER CASE 9
w=input()
case= {"UPPERCASE":0,"LOWERCASE":0}
forwordinw:
ifword.isupper():
case["UPPERCASE"]+=1
elifword.islower():
case["LOWERCASE"]+=1
else:
pass
print("Upper Case: ",case["UPPERCASE"])
print("Lower Case: ",case["LOWERCASE"])