19
loading...
This website collects cookies to deliver better user experience
txt=" Computer Academy"
print(txt)
#Returns True if all characters in the string are alphabets
print("1.", "\tisalpha()\t", txt.isalpha())
#Returns True if all characters in the string are only alphanumeric
txt="Level1"
print("\n",txt)
print("2.", "\tisalnum()\t", txt.isalnum())
#Returns True if all characters in the string are digits
txt="1154"
print("\n",txt)
print("3.", "\tisdigit()\t", txt.isdigit())
#Returns True if all characters in the string are lower case
txt="computer academy"
print("\n",txt)
print("4.", "\tislower()\t", txt.islower())
#Returns True if all characters in the string are whitespaces
txt="computer academy"
print("\n",txt)
print("5.", "\tisspace()\t", txt.isspace())
#Returns True if the string follows the rules of a title
txt="Computer Academy"
print("\n",txt)
print("6.", "\tistitle()\t", txt.istitle())
#Returns True if all characters in the string are upper case
txt="PYTHON PROGRAMMING"
print("\n",txt)
print("7.", "\tisupper()\t", txt.isupper())
Computer Academy
1. isalpha() False
Level1
2. isalnum() True
1154
3. isdigit() True
computer academy
4. islower() True
computer academy
5. isspace() False
Computer Academy
6. istitle() True
PYTHON PROGRAMMING
7. isupper() True