forked from kennyyu/bootcamp-python
-
Notifications
You must be signed in to change notification settings - Fork 17
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
my first pull request #9
Open
W4ngatang
wants to merge
17
commits into
hcs:master
Choose a base branch
from
W4ngatang:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+52
−17
Open
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0612675
finished hello world example
W4ngatang a9e795f
commit python script
W4ngatang 5ed4659
finished spell checker
W4ngatang 3be1df2
finished problem 1
W4ngatang 6da92b5
finished problem 1
W4ngatang 78ae3d5
finished problem 2
W4ngatang df15368
finished problem 3
W4ngatang e19cc19
finished problem 4
W4ngatang 316c82a
finished problem 5
W4ngatang 31c13e6
finished problem 6
W4ngatang 02c6458
finished problem 7
W4ngatang 8dea239
finished problem 8
W4ngatang 4cb5e9e
finished problem 12
W4ngatang 06c4c6c
finished problem 11
W4ngatang e687f96
finished problem 9
W4ngatang e8228bd
finished problem 10
W4ngatang d725724
revisions
W4ngatang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
# | ||
# TODO: write your code below | ||
|
||
print "hello world" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env python | ||
print "this is a python script!" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,22 +16,26 @@ def load(dictionary_name): | |
Each line in the file contains exactly one word. | ||
""" | ||
# TODO: remove the pass line and write your own code | ||
pass | ||
s = set() | ||
words = open(dictionary_name, "rb") | ||
for word in words: | ||
s.add(word.strip()) | ||
return s | ||
|
||
def check(dictionary, word): | ||
""" | ||
Returns True if `word` is in the English `dictionary`. | ||
""" | ||
pass | ||
return word in dictionary | ||
|
||
def size(dictionary): | ||
""" | ||
Returns the number of words in the English `dictionary`. | ||
""" | ||
pass | ||
return len(dictionary) | ||
|
||
def unload(dictionary): | ||
""" | ||
Removes everything from the English `dictionary`. | ||
""" | ||
pass | ||
dictionary = () | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also dictionary.clear() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can also use set comprehensions: