-
Notifications
You must be signed in to change notification settings - Fork 11
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
Python challenge- HW #15
base: master
Are you sure you want to change the base?
Conversation
HW python.py
Outdated
@@ -0,0 +1,16 @@ | |||
#my code: | |||
|
|||
with open('text.txt') as file: |
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.
with...open... context should only include file operation
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.
@AviadP I changed the file mode - read mode
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.
pls use "with..open..." context manager, as explained in class
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.
@AviadP i change at the new file to - with open('text.txt', 'r') as file
HW python.py
Outdated
|
||
with open('text.txt') as file: | ||
List=file.read().split() | ||
wordDict={} |
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.
plz follow python style guide for variable names = this one should be "word_dict", but anyway try to chose better variable names, something that describe the purpose of this var
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.
@AviadP I renamed it meaningful - word_counter
and in the second problem i renamed to f_read instead of List
HomeWork Python
@AviadP