0
What is the problem here
while True: A=int(input("saisir un entier")) B=int(input("saisir un 2 entier")) if (10<=A<=60) and (10<=B<=60): break
1 Answer
+ 8
When using mutiple conditions, you have to hardcode each variable and use logical operators.
if (10 <= A <= 60)
# should be
if (A >= 10 and A <= 60)
Same with the second condition on variable "B".
Because for example A is 70:
if (10 <= 70 <= 60)
if (1 <= 60)
>> True
The interpreter will run the condition left to right and it will first evaluate 10 <= 70 which is True so 1 (truthy).
Then, 1 <= 60 is True though 70 in fact, is not between 10 and 60.