De opdracht laden…
In this list of marks, True means a sheep is present and False means it is missing. Write count_sheeps, which counts how many True values are in the list arr. If the list is empty or all values are False, the result should be 0.
[True, True, False, True]3[False, False]0[]0def count_sheeps(arr: list[bool]) -> int:
Log in om je inzendingsgeschiedenis te zien
InloggenLog in om de AI-mentor te gebruiken
Inloggen[true,true,false,true]3[false,false]0[]0[true,true,true]3[true,false,true,false,true]3[true,true,true,true,true]5