Ad
Code
Diff
  • def pin_validator(pin):
        return len(str(pin)) == 5 and str(pin).isdigit() 
    • function pinValidator(pin) {
    • var pinLength = pin.length;
    • var pinIsCorrect = (pinLength === 4 || pinLength === 6);
    • var onlyNumbers = pin.match (/^\d+$/);
    • if (pinIsCorrect && onlyNumbers){
    • return true;
    • console.log("TRUE");
    • }
    • else {
    • return false;
    • console.log("FALSE");
    • }
    • };
    • pinValidator('88888');
    • def pin_validator(pin):
    • return len(str(pin)) == 5 and str(pin).isdigit()