+ 1

how can i limit numbers in python ?

i cant limit numbers . how can i limit numbers example question like this the question 1<n<10000 but i coudnt find solution can you give me support

4th Oct 2022, 6:03 AM
Samandar Turobov
Samandar Turobov - avatar
2 Answers
+ 3
Samandar Turobov , you can use this procedure: # loop (1) input a number and convert it to int (2) check if number is in the required range > if number is correct, exit the loop > otherwise input will be repeated
4th Oct 2022, 6:32 PM
Lothar
Lothar - avatar
0
thank you can i use it like this a=int(input(range(1,10001)))
4th Oct 2022, 7:18 AM
Samandar Turobov
Samandar Turobov - avatar