Hey guys.I wonder if there is any "special word" for all the letters (not numbers) which I can use so I dont to have a huge list | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hey guys.I wonder if there is any "special word" for all the letters (not numbers) which I can use so I dont to have a huge list

3rd Jul 2017, 2:05 PM
Sindre Havn
Sindre Havn - avatar
3 Answers
+ 1
Try this: name = "my name is sapphire" name_2 = "my name is 123abc" name_3 = "Sapphire" print(name.isalpha()) print(name_2.isalpha()) print(name_3.isalpha ()) #Output: False False True The isalpha() method checks to see if the string contains at least 1 or more letters in the string. True if all are letters, False if anything else is there like whitespace or numbers.
3rd Jul 2017, 3:08 PM
Sapphire
+ 6
alphabet? 😋
3rd Jul 2017, 2:09 PM
jay
jay - avatar
+ 1
import string print(string.ascii_letters)
4th Jul 2017, 7:11 AM
richard