No BS: It is important to try and implement known ‘easy’ algorithms as it provides practice on working towards trickier algorithms, as well as translating human instructions into a usable program. With BS: Working through Exercise 20 of practicepython.org, you are tasked to implement the Binary Search Algorithm for a sorted list of numerical integers, […]Read more "Binary Search Algorithm"
No BS: Previous code didn’t strip out punctuation and left us with weird duplicates of words. For example, “the”, “the–“, and “(the” would all be considered separate words. I added a piece of code to strip out the punctuation which was: out = s.translate(str.maketrans(”, ”, string.punctuation)) I then sorted the words based on the output […]Read more "Word/Count Dict (Part 2)"
No BS: Given a .txt file, count the appearance of each word (ignoring case) and do either: Print a full list sorted by alphabetical order. Print a list of the top 20 most common words. Taken from Google’s Python class: https://developers.google.com/edu/python/dict-files (bottom of the page). Once I’ve figured out how to display code snippets correctly […]Read more "Word/Count Dict (Part 1)"