While Validation Loop Python Script Generator