How to keep a user from entering a character or a word for a number (int) input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to keep a user from entering a character or a word for a number (int) input

When you ask a numeric input from a user but he/she enters a word or a letter, how can you print an error message saying you only accept numbers? How do you write that line of code?

25th Jul 2018, 7:12 PM
Cem
Cem - avatar
1 Answer
25th Jul 2018, 9:41 PM
Hatsy Rei
Hatsy Rei - avatar