추가 '대소문자 개수 체크'

This commit is contained in:
kim_yubin 2018-10-28 11:57:41 +09:00
parent aad229b21a
commit 3cef25be25
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
# 65~90 = 대문자
# 97~122 = 소문자
a=input("")
resultA=0
resultB=0
for b in a:
c=ord(b)
if c>64 and c<91:
resultA += 1
if c>96 and c<123:
resultB += 1
print("대문자의 개수는 " + str(resultA) +"개입니다")
print("소문자의 개수는 " + str(resultB) +"개입니다")