+ 1
How can we only put integer as a input in python
5 Réponses
+ 2
You can use int(input()) but your input should be able to handle if user enters non integer type..
+ 5
ARYAN JAT👑💯💯 ,
do you mean, how we can make sure that only *digits* are given as input? try to describe your needs a bit more in detail.
> maybe just give sample/s.
+ 2
Int(input)
Or better still create a function that checks if an input is digit or not. It handles error better
+ 1
int(input())
+ 1
You should convert the format of input to int