Created
October 21, 2022 12:41
-
-
Save RaMSFT/e3ee6373bd3017aba19eb1cc7eed6d83 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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