+ 1
i need help in python more precisely advise. I'm making code with input and i only need natural numbers.
how can i determine only natural nambers with if . idea is that when user types number he/she will get binary as an output, but there is an probably of making error with just wrong type input.
2 Answers
+ 5
if type(a)==int and a>0
or you can use try/except