Counts uppercase lowercase and total characters in a word using python code #shorts #coding #python

preview_player
Показать описание
count how many uppercase and lowercase characters are in a word using Python!

Code:
# check is the character is upper or lower
word = input("Enter the word :")
length = 0
upper = 0
lower = 0

for i in word:
length = length + len(i)
upper = upper + 1
lower = lower + 1

print("The length is :", length)
print("The upper case is :", upper)
print("The lower case is :", lower)

Use `isupper()` and `islower()` to check character case easily.

#Python #Shorts
Рекомендации по теме
visit shbcf.ru