Validating multiple inputs in a loop different variable types explained