Professional Documents
Culture Documents
Python Validation Functions
Python Validation Functions
For each of the challenges below you need to create a function that validates input against the criteria
Rules
● You must comment the type (or types) of validation that is occurring in the function.
● Each function will take one (or more) parameter
● Each function will return True or False depending on whether tests are passed/failed
--------------------------------------------------------------------------------------------------------------------------------------------------
-
● The year must be between 1900 and the current year(use the datetime module)
● Valid format:
● [2 letters] [1 or 2 Digits] [Space] [1 Digit] [2 letters]
● (This is a slight simplification from the real UK postcode system to make the challenge a little easier)
● Hint: You might want to use the .partition string method.