Python Function Define Input Validation