Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

16. count total numbers of uppercase and lowercase characters in input string python

s = "The Geek King"
l,u = 0,0
for i in s:
    if (i>='a'and i<='z'):
          
        # counting lower case
        l=l+1                 
    if (i>='A'and i<='Z'):
          
        #counting upper case
        u=u+1   
          
print('Lower case characters: ',l)
print('Upper case characters: ',u)
Comment

PREVIOUS NEXT
Code Example
Python :: get forex exchange rates in python 
Python :: python fft 
Python :: check if string is palindrome using recursion in python 
Python :: NumPy bitwise_or Syntax 
Python :: NumPy right_shift Syntax 
Python :: Convertion of an array into binary using NumPy binary_repr 
Python :: django view - Generic class based view (listc, create, retrieve, update or delete - GET, POST, GET, PUT, DELETE) 
Python :: wget http://xael.org/norman/python/python-nmap/pythonnmap- 0.2.4.tar.gz-On map.tar.gz 
Python :: python override inherited method data model constructor 
Python :: fibo_itrativ 
Python :: penggunaan fromkeys di python 
Python :: Remove Brackets from List Using the Translate method 
Python :: raspberry pi set python 3 as default 
Python :: lsit to dataframe 
Python :: gremlin python import 
Python :: django.db.utils.ProgrammingError: (1146 
Python :: kaggle set utility script 
Python :: sqlite basic 
Python :: HTML default value fo radio button input type based on python variable 
Python :: session timeout flask 
Python :: KeyError: 0 python 
Python :: merging results from model.predict() prediction with original pandas dataframe 
Python :: print all gpu available tensor 
Python :: python run unix command 
Python :: matplotlib plot dpi - change format to retina instead of svg 
Python :: tkinter trig calculator 
Python :: poset save @reciever created 
Python :: rounding with .2g gives strange results 
Python :: set constructor python 
Python :: ptyhton json respones 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =