This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def get_list_index(list_obj, item, alternative=None): | |
try: | |
return list_obj.index(item) | |
except: | |
if alternative is not None: | |
try: | |
return list_obj.index(alternative) | |
except: |