print the character from string if character is alphabet

0 votes
Sep 17 in Python by GHAZALA
• 160 points
34 views

1 answer to this question.

0 votes

You can use str.isalpha()

For example:

s = 'a123b'

for char in s:
    print(char, char.isalpha())

OUTPUT

a True
1 False
2 False
3 False
b Tru
answered Sep 18 by Roshni
• 4,630 points

Related Questions In Python

0 votes
1 answer

How to print a message or the error if a file is not found?

To print the message that file is not ...READ MORE

answered Jan 2, 2019 in Python by Omkar
• 69,030 points
160 views
0 votes
2 answers

Finding the index of a character in python string

You can use word.find('o') as well to ...READ MORE

answered Jun 1, 2018 in Python by george
• 200 points
321 views
+1 vote
1 answer

How to print first character of each word in upper case of a string in Python

You can use split() using space as ...READ MORE

answered Jun 1, 2018 in Python by george
• 200 points
5,497 views
0 votes
2 answers

Delete a character from pythons string

If you want to remove the 'J' ...READ MORE

answered Jun 12, 2018 in Python by anonymous
87 views
+1 vote
1 answer

How to check if a string is null in python

Try this: if cookie and not cookie.isspace(): # the ...READ MORE

answered Aug 20, 2018 in Python by Priyaj
• 57,680 points
15,316 views
0 votes
1 answer

Is there anyway to obtain the full abstract from a 'PUBmed' article using bioPython

Hey Charlie, it's certainly possible to pull ...READ MORE

answered Aug 23, 2018 in Python by aryya
• 7,380 points
1,121 views
0 votes
3 answers

Python program to print occurrence of character in string

Try the below code inputString = input("Enter a ...READ MORE

answered Feb 26, 2019 in Python by Anubhav
• 200 points
6,942 views
0 votes
1 answer

How do I check if input string is a valid regular expression or not in Python?

Hi. Good question! Well, just like what ...READ MORE

answered Feb 12, 2019 in Python by Nymeria
• 3,520 points
5,038 views
0 votes
1 answer

What is the Python logic to count the number of capital letters in a file?

Hi, You can use this piece of code, ...READ MORE

answered Jun 26 in Python by Roshni
• 4,630 points
72 views
0 votes
1 answer

How to convert each list item into string in a column of data frame. ?

Hey, To split a string you can use ...READ MORE

answered Feb 5 in Python by Roshni
• 4,630 points
168 views