Last active
June 15, 2020 04:52
-
-
Save toniesteves/78f18cc88c1c8c4b0f7ad9ddc52ad368 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
import time | |
lot_of_items = ['coffee'] * 100000 | |
def find_coffee(items): | |
start = time.time() | |
for item in items: | |
if(item == 'coffe'): | |
print('Found Coffee') | |
finish = time.time() | |
print('The operation took {} ms'.format(finish - start)); | |
find_coffee(lot_of_items); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment