Completed python matrix task