Created
September 10, 2018 23:57
-
-
Save matin/8924f03f091963f7059c9e3eef774226 to your computer and use it in GitHub Desktop.
validate bank code for CLABE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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