We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defchecker(s,values,validation):""" Populates a list 'values' with strings 'True' or 'False' verifying thestring's'bythefunctiongivenby'validation'"""foritemins:ifvalidation(item):values.append('True')else:values.append('False')returnvaluesdefexecutor(s,values,validation):""" Clears the values list, applies the checker function andreturnstheappropriatevalue"""values.clear()print(Trueif'True'inchecker(s,values,validation)elseFalse)if__name__=='__main__':s=input()values=[]executor(s,values,str.isalnum)executor(s,values,str.isalpha)executor(s,values,str.isdigit)executor(s,values,str.islower)executor(s,values,str.isupper)
Cookie support is required to access HackerRank
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 →