De opdracht laden…
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]Falsedef no_13(nums: list[int]) -> bool:
Log in om je inzendingsgeschiedenis te zien
InloggenLog in om de AI-mentor te gebruiken
Inloggen[1,2,3,4]False[2,4,5]True[3,1]False[]True[2,2,2]True[4,3,2,1]False