Created
April 25, 2016 12:46
-
-
Save antongorshkov/1bcb77ef172dc27639b88ea662c6ddfb 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 pprint | |
with open('fruits') as f: | |
d = dict([x.rstrip(),1] for x in f) | |
fruit = raw_input('Enter fruit: ').title() | |
if fruit in d: | |
print('Got it!') | |
else: | |
print('No luck!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment