This document contains Python code that uses string methods like isalnum(), isalpha(), isdecimal(), isdigit(), isidentifier(), islower(), isnumeric(), isspace(), istitle(), and isupper() to check properties of different string values and return True or False. Each method checks strings against a specific criteria like containing only letters, only numbers, proper title format, etc. and prints the output.
This document contains Python code that uses string methods like isalnum(), isalpha(), isdecimal(), isdigit(), isidentifier(), islower(), isnumeric(), isspace(), istitle(), and isupper() to check properties of different string values and return True or False. Each method checks strings against a specific criteria like containing only letters, only numbers, proper title format, etc. and prints the output.
This document contains Python code that uses string methods like isalnum(), isalpha(), isdecimal(), isdigit(), isidentifier(), islower(), isnumeric(), isspace(), istitle(), and isupper() to check properties of different string values and return True or False. Each method checks strings against a specific criteria like containing only letters, only numbers, proper title format, etc. and prints the output.
This document contains Python code that uses string methods like isalnum(), isalpha(), isdecimal(), isdigit(), isidentifier(), islower(), isnumeric(), isspace(), istitle(), and isupper() to check properties of different string values and return True or False. Each method checks strings against a specific criteria like containing only letters, only numbers, proper title format, etc. and prints the output.
isalnum())#True-- if it contians only a to z or A to Z or 0 to 9
print("abc 123".isalnum()) print("abc@123".isalnum()) print("welcome".isalnum()) print("75874".isalnum()) print("----------------") print("abc123".isalpha())#True-- if it contians only a to z or A to Z print("welcome".isalpha()) print("hi to all".isalpha()) print("----------------") print("abc123".isdecimal())#True-- if it contians only 0 to 9 print("123".isdecimal()) print("55.123".isdecimal()) print("-123".isdecimal()) print("----------------") print("abc123".isdigit())#True-- if it contians only 0 to 9 print("123".isdigit()) print("55.123".isdigit()) print("-123".isdigit()) print("abc123".isidentifier())#True-- if it fallows rules of identifier the =n it will True print("abc 123".isidentifier()) print("45abc123".isidentifier()) print("____".isidentifier()) print("------------------") print("aqeel 345".islower()) print("aqeel 345 Welcmoe".islower()) print("------------------") print("aqeel 345".isnumeric()) print("345".isnumeric()) print("345.56".isnumeric()) print("-345".isnumeric()) print("------------------") print("aqeel 345".isspace()) print(" ".isspace()) print("------------------") print("aqeel 345".istitle()) print("The Hello To All".istitle()) print("------------------") print("aqeel 345".isupper()) print("THE".isupper())