Python Function Define Input Validation Html