Added function and ternary operation

Added function to check if inputs are blank or not. Added ternary
condition inside the function that returns a boolean value.