You are viewing a single comment's thread. Return to all comments →
<#> def check_string(s): ''' Function to check if a string contains any characters that are alpha-numeric, alphabetical, digits, lowercase and uppercase. ''' alnum, alpha, digit, lower, upper = False, False, False, False, False for ch in s: if(alnum == False and ch.isalnum()): alnum = True if(alpha == False and ch.isalpha()): alpha = True if(digit == False and ch.isdigit()): digit = True if(lower == False and ch.islower()): lower = True if(upper == False and ch.isupper()): upper = True
print(alnum) print(alpha) print(digit) print(lower) print(upper) return
<#>
Seems like cookies are disabled on this browser, please enable them to open this website
String Validators
You are viewing a single comment's thread. Return to all comments →
<#> def check_string(s): ''' Function to check if a string contains any characters that are alpha-numeric, alphabetical, digits, lowercase and uppercase. ''' alnum, alpha, digit, lower, upper = False, False, False, False, False for ch in s: if(alnum == False and ch.isalnum()): alnum = True if(alpha == False and ch.isalpha()): alpha = True if(digit == False and ch.isdigit()): digit = True if(lower == False and ch.islower()): lower = True if(upper == False and ch.isupper()): upper = True
<#>