Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to check if a letter is lowercase in python

for c in s:
    if c.islower():
         print c
Comment

Python Program to count the number of lowercase letters and uppercase letters in a string.

string=raw_input("Enter string:")
count1=0
count2=0
for i in string:
      if(i.islower()):
            count1=count1+1
      elif(i.isupper()):
            count2=count2+1
print("The number of lowercase characters is:")
print(count1)
print("The number of uppercase characters is:")
print(count2)
Comment

python all lowercase letters

import string
print string.ascii_lowercaseOutputabcdefghijklmnopqrstuvwxyz
Comment

string upper lower count python

# count uppercase,lowercase,digits and special characters.
a=input('enter the string:')
u=l=d=s=0
for i in a :
    if i.isupper():
        u+=1
    elif i.islower():
        l+=1
    elif i.isdigit():
        d+=1
    else:
        s+=1
print('if the string is upper',u)
print('if the string is lower',l)
print('if the string is digit',d)
print('if the string is special',s)

#output:
'''
enter the string: 'Hii Buddy! How Have You BEEN , Welcome To PYTHON....
if the string is upper 17
if the string is lower 20
if the string is digit 0
if the string is special 17
'''

Comment

PREVIOUS NEXT
Code Example
Python :: numpy item size 
Python :: pandas apply function on two columns 
Python :: what is imageTk in pil python 
Python :: django template for loop 
Python :: pandas length of array in column 
Python :: difference between object and class in python 
Python :: import pil pycharm 
Python :: generate new secret key django 
Python :: Using Variables with Multiple Instances of a Python Class 
Python :: python get attributes of class 
Python :: python convert dict to xml 
Python :: how to unique list in python 
Python :: list sort by key python 
Python :: find common values in different dataframes pandas 
Python :: returns the smallest positive integer python 
Python :: python get item from queue 
Python :: strings are immutable in python 
Python :: python merge two dictionaries in a single expression 
Python :: create exe from python script 
Python :: armstrong python 
Python :: python pillow resize image 
Python :: python array to string 
Python :: print map object python 
Python :: _getfullpathname: path should be string, bytes or os.PathLike, not list 
Python :: beautifulsoup remove all html tags 
Python :: how to add two numbers in python 
Python :: sort a stack using recursion 
Python :: drop column pandas 
Python :: templateDoesNotExist Django 
Python :: python find intersection of two lists 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =