No Forbidden Values
Sometimes you need to check that a list does not contain forbidden values before processing it. Write a function no_13 that takes a list nums and checks that it contains neither 1 nor 3. Return True if both numbers are absent, otherwise return False.
Примеры
Ввод
[1, 2, 3, 4]Вывод
FalseВвод
[2, 4, 5]Вывод
TrueВвод
[3, 1]Вывод
FalseНужно реализовать
def no_13(nums: list[int]) -> bool:
Теги
listsarray
Prisijunkite, kad matytumėte pateikimų istoriją
PrisijungtiPrisijunkite, kad naudotumėte DI mentorių
PrisijungtiVisible tests
1
Input
[1,2,3,4]Expected
False2
Input
[2,4,5]Expected
True3
Input
[3,1]Expected
False4
Input
[]Expected
True5
Input
[2,2,2]Expected
True6
Input
[4,3,2,1]Expected
FalseFocus radio
Paused · SomaFM · Fluid