Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Remove All Before by Teja_002
def remove_all_before(lst, num):
if num not in lst:
return lst
i = lst.index(num)
return lst[i:]
if __name__ == '__main__':
print("Example:")
print(list(remove_all_before([1, 2, 3, 4, 5], 3)))
print(list(remove_all_before([1, 2, 3, 4, 5], 7)))
Feb. 24, 2021
Comments: