Skip to content

Instantly share code, notes, and snippets.

@ycui1
Created October 25, 2021 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ycui1/2d04b7644c91357aef3fc1dd5db7d060 to your computer and use it in GitHub Desktop.
Save ycui1/2d04b7644c91357aef3fc1dd5db7d060 to your computer and use it in GitHub Desktop.
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