Skip to content

Instantly share code, notes, and snippets.

@koifish082
Created August 24, 2018 01:02
Show Gist options
  • Save koifish082/06f01cd5eaa7fc76ae9a7b8ecf6aa955 to your computer and use it in GitHub Desktop.
Save koifish082/06f01cd5eaa7fc76ae9a7b8ecf6aa955 to your computer and use it in GitHub Desktop.
list_key_exist: It's like array_key_exists in php
class ListUtil:
@staticmethod
def list_key_exist(sample_list, index):
if len(sample_list) > index:
print(sample_list[index])
return
print("-1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment