Skip to content

TypeScript code snippet – How to check if a string is composed only of alphabets in python?

str1 = "hello world. welcome to python examples."

bool = str1.isalpha()

print('str1 contains only alphabets:', bool)
//output will be False
See also  Converts Fahrenheit to Celsius in Python

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.