Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First python scripts #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

First python scripts #6

wants to merge 3 commits into from

Conversation

gputnam
Copy link

@gputnam gputnam commented Nov 7, 2013

No description provided.

@@ -16,22 +16,29 @@ def load(dictionary_name):
Each line in the file contains exactly one word.
"""
# TODO: remove the pass line and write your own code
pass
dic = open(dictionary_name, "r")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

careful with indentation. another cool thing to use is set comprehensions:

return {word.strip() for word in open(dictionary_name, "r")}

@kennyyu
Copy link
Collaborator

kennyyu commented Nov 12, 2013

try finishing the rest of the exercises!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants