Inside or Outside

Sometimes one flag completely changes the meaning of a range check: you either look inside the range or outside it. Write a function in1to10 that takes a number n and the boolean flag outside_mode. If outside_mode is False, return True when n is from 1 to 10 inclusive. If outside_mode is True, return True when n is less than or equal to 1 or greater than or equal to 10.

Примеры

Ввод
5, False
Вывод
True
Ввод
11, False
Вывод
False
Ввод
11, True
Вывод
True

Нужно реализовать

def in1to10(n: int, outside_mode: bool) -> bool:

Теги

math
PostgreSQLv16

Hawn jidher ir-riżultat tat-tħaddim tal-kodiċi

Visible tests
1
Input
5, False
ExpectedTrue
2
Input
11, False
ExpectedFalse
3
Input
11, True
ExpectedTrue
4
Input
10, False
ExpectedTrue
5
Input
10, True
ExpectedTrue
6
Input
5, True
ExpectedFalse
Focus radio
Paused · SomaFM · Fluid