python - How to print list of strings but skip the first item / jump to ...

Instead of hard-coding 1 as an index, we'll look for the first index in the list where a provided value occurs and use that to get a list slice. def list_slice_from_value_to_end(lst, val): try: return lst[lst.index(val):] except ValueError: return [] Now we can write a loop like the following:

Visit visit

Your search and this result

  • The search term appears in the result: python array slicing example
  • The website matches one or more of your search terms
  • Other websites that include your search terms link to this result
  • The result is in English (India)