Skip to main content

Write a python program to check upper and lower case letters in a string.


str1=input("Enter the string")
print(str1)
uprcase=0
lwrcase=0
i=0
while(i<len(str1)):
    if(str1[i].islower()==True):
        lwrcase+=1
    if(str1[i].isupper()==True):
        uprcase+=1
    i+=1
print("No of upper case letters in the string=",uprcase)
print("No of lower case letters in the string=",lwrcase)


Comments

Popular posts from this blog

Write a program to show the use of recursion in calculation of power.

#Program to show the use of recursion in calculation  of power. #Code #power a to b using recursion 6_4

Factorial of a number

Q:1 Write a program to Calculate the factorial of the inputted numbers. Program: 1: