Created
October 25, 2021 01:57
-
-
Save ycui1/2d04b7644c91357aef3fc1dd5db7d060 to your computer and use it in GitHub Desktop.
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
def any_like_fruit_break(fruits, liked_fruit): | |
liked = False | |
for fruit in fruits: | |
print(f"Checking {fruit} likable") | |
if fruit == liked_fruit: | |
liked = True | |
break | |
print("Found liked") | |
return liked | |
any_like_fruit_break(["apple", "pineapple", "orange"], "pineapple") | |
Checking apple likable | |
Checking pineapple likable | |
Found liked |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment