+ 1

in "basic programming", there is a "not isnumber" command to check whether the user inputs a number or not. is there in python?

15th Oct 2018, 1:46 PM
Bayu Saputra
Bayu Saputra - avatar
2 ответов
+ 2
Python strings (which is what input() gives you) have an isdigit() method that returns a boolean e.g. user_in = input() print(user_in.isdigit())
15th Oct 2018, 1:53 PM
TurtleShell
TurtleShell - avatar
0
thank you bro TurtleShell ... i will try it..
15th Oct 2018, 1:56 PM
Bayu Saputra
Bayu Saputra - avatar