Skip to content

Instantly share code, notes, and snippets.

@matin
Created September 10, 2018 23:57
Show Gist options
  • Save matin/8924f03f091963f7059c9e3eef774226 to your computer and use it in GitHub Desktop.
Save matin/8924f03f091963f7059c9e3eef774226 to your computer and use it in GitHub Desktop.
validate bank code for CLABE
from enum import Enum
class BankCode(Enum):
BANAMEX = '002'
BBVA_BANCOMER = '012'
SANTANDER = '014'
def validate_bank_code(bank_code: str) -> bool:
try:
BankCode(bank_code)
except ValueError:
valid = False
else:
valid = True
return valid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment