Created
October 14, 2022 10:24
-
-
Save RaMSFT/51f7924fa752491765badd06e61513f8 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_number_in_list(lst, num): | |
| if num in lst: | |
| result = f"{num} exist in the list" | |
| else: | |
| result = f"{num} doesn't exist in the list" | |
| return result | |
| print(check_number_in_list([1, 2, 3, 4, 5], 3) ) | |
| print(check_number_in_list([1, 1, 2, 1, 1], 3) ) | |
| print(check_number_in_list([5, 5, 5, 6], 5) ) | |
| print(check_number_in_list([], 5) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment