I need the user to input a number, but the number must be above 1 and below 50 and it must be a number, not a symbol or letter. The input will then show up as asterisks, such as if they input 5 they would then see *****. I need a function that outputs an error message if the input is invalid. How do I ensure that the input will be correct and let the user know when it isn't?

Any help would be appreciated