-
-
Save fredj/3953427 to your computer and use it in GitHub Desktop.
AWB (Airway bill) number validation
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
import re | |
def valid(awb): | |
m = re.match('\d{3}(?P<serial>\d{7})(?P<check>\d)\Z', str(awb)) | |
return int(m.group('serial')) % 7 == int(m.group('check')) if m else False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment