Monday, December 7, 2015

Using Specific Module Functions in Functions


To solve the second problem in problem set 5, I decided to put the majority of the code in a function. I needed to use the sqrt function from the math module however it did not want to work on its own. I used specifically the following code to be able to use the sqrt function inside my quadratic solver function.

from math import sqrt

Sunday, December 6, 2015

Solving the Word Guesser


I was trying to solve the word guesser problem and I realized I needed to compare using lists. The lists would allow me to compare the letters 1 by 1 and space by space so the spaces would be correct. Using the list function allowed me to split both the random word and the users guess into individual lists to compare.

Thursday, December 3, 2015

Using the Random Module and Functions



For the first problem in the set, I was able to import the random and use the randint function to generate a random integer. I was able to choose the parameters "(1, 99)"