did problem 2 using python generators

Signed-off-by: Nicholas Bevacqua <videogamerz400@gmail.com>