Adding python/ruby solutions for problem 6