Binary Search Algorithm

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"

Word/Count Dict (Part 2)

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)"