Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Created October 21, 2022 12:41
Show Gist options
  • Save RaMSFT/e3ee6373bd3017aba19eb1cc7eed6d83 to your computer and use it in GitHub Desktop.
Save RaMSFT/e3ee6373bd3017aba19eb1cc7eed6d83 to your computer and use it in GitHub Desktop.
def check_elemnt_in_list(input_list, value):
if value in input_list:
return f"Given value: {value} exists in the list"
else:
return f"Given value: {value} doesn't exists in the list"
print(check_elemnt_in_list(["hi", "edabit", "fgh", "abc"], 'fgh'))
print(check_elemnt_in_list(["Red", "blue", "Blue", "Green"], 'blue'))
print(check_elemnt_in_list(["a", "g", "y", "d"], 'd'))
print(check_elemnt_in_list(["Pineapple", "Orange", "Grape", "Apple"], "Pineapple"))
print(check_elemnt_in_list(["Pineapple", "Orange", "Grape", "Apple"], "pp"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment