Python Cache

Below is some code (also on my Github account) that makes use of cache to quickly respond to requests. The actual calculation isn’t too useful. It’s an alternate way of performing multiplication.  What is useful however, is that the first time we call the function, it checks if it is Continue Reading

Python & Selenium

Step 1: Install Selenium libraries with Python.  If you are using Python3, then you would use: pip3 install selenium If using Pre-Python3: pip install selenium Step 2: In your Python script, import the libraries you need… like: from selenium import webdriver from selenium.webdriver.common.keys import Keys Step 3: Write the selenium Continue Reading

Python Palindrome Test

Code Exercise Years ago I used to say if I was given a palindrome test for Ruby, I’d just write: some logic that if the variable = variable.reverse() then it’s a palindrome. HA! Such a solution doesn’t exercise thinking, and wouldn’t really ace an interview. While learning Python, I wrote Continue Reading

Python: While

Over at the codecademy.com, this was my python solution for their exercise on a random number game: from random import randint # Generates a number from 1 through 10 inclusive random_number = randint(1, 10) guesses_left = 3 # Start your game! while guesses_left >0: guess = int(input(“What is your guess?”)) Continue Reading