본문 바로가기
프로그래밍 문제/[Python] CheckIO

[CheckIO] Remove All After

by UltraLowTemp-Physics 2021. 3. 22.
728x90

1. Problems : py.checkio.org/en/mission/remove-all-after/
2. My Solution; 

def remove_all_after(items: list, border: int) -> Iterable:
    # your code here
    return items[:items.index(border) + 1] if border in items else items

 

728x90

'프로그래밍 문제 > [Python] CheckIO' 카테고리의 다른 글

[Check-IO] Frequency Sorting  (0) 2021.04.18
[CheckIO] Median  (0) 2021.03.23
[Check-IO] Lightbulb Intro  (0) 2021.03.17
[CheckIO] Majority  (0) 2021.03.11
[CheckIO] Backward Each Word  (0) 2021.03.10

댓글