Python programming class homework