Hello, I´m a beginner so I´ve must missed something... in the last sequence check, the sequence is [10, 1, 5, 6, 7, 10], and the border is 5, so the solution is [5,6,7,10]. My problems is understanding why the first '10' in the sequence is removed instead of preserved. Please help me understanding. Thanks in advance.
My code:
from collections.abc import Iterable
#
def removeallbefore(items: list, border: int) -> Iterable:
if items.count(border)==0:
return items
else:
newit=[]
for item in items:
if item>=border:
newit=newit+[item]
return newit
Created at: 2024/02/07 14:26; Updated at: 2024/02/07 15:10
The question is resolved.