You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass an argument into your read_words(), it would be modular and you can pass any file and read from it. e.g. read_words(pathname)
Histogram:
If you see 1 code is repeated multiple places consider if you can make a helper function and reuse the same code. It helps you write DRY code. Learn here more about it here.
Most of your functions in your word_count.py don't take any parameters, if you pass parameters thoughtfully you can make your code much more modular.
Pay attention to your syntax, I saw on multiple places you left space after function parentheses. E.g. def frequency (word, histogram): should be def frequency(word, histogram):
Sample words by frequency:
Seems like your code is working but to make 100% sure test your code by running your sample function like 1000 times or so. and see if it is working.
Add comments if line of code needs explanation. E.g. random_word = random.randint(0,7) you can explain why you are using 0 and 7 as a range?
Create Flask Web App
Don't forget to add app.run() line in your main function to run your flask app.
You shouldn't be pushing your venv folders to your GitHub it should live in your local machine. Because it takes a memory and slows down when you are pushing to github. Learn more here why it is not recommended to push your venv folder to Github.
Markov chain
Not attempted.
The text was updated successfully, but these errors were encountered:
UPDATED
Random dictionary words:
read_words()
, it would be modular and you can pass any file and read from it. e.g.read_words(pathname)
Histogram:
word_count.py
don't take any parameters, if you pass parameters thoughtfully you can make your code much more modular.space
after function parentheses. E.g.def frequency (word, histogram):
should bedef frequency(word, histogram):
Sample words by frequency:
sample
function like 1000 times or so. and see if it is working.random_word = random.randint(0,7)
you can explain why you are using0 and 7
as a range?Create Flask Web App
app.run()
line in your main function to run your flask app.venv
folders to your GitHub it should live in your local machine. Because it takes a memory and slows down when you are pushing to github. Learn more here why it is not recommended to push yourvenv
folder to Github.Markov chain
The text was updated successfully, but these errors were encountered: