Interation 2 for python matrix exercise