Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def any_liked_fruit(fruits, liked_fruit):
liked = False
for fruit in fruits:
print(f"Checking {fruit} likable")
if not liked and fruit == liked_fruit:
liked = True
print("Found liked")
return liked
any_liked_fruit(["apple", "pineapple", "orange"], "pineapple")
Checking apple likable
Checking pineapple likable
Checking orange likable
Found liked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment