No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
[code=python] import random class gameOfLife(object): def __init__(self, columns, rows, grid = []): self.grid = grid self.columns = columns self.rows = rows for i in range(0,self.rows): sub = ['-'] self.grid.append(sub) for sublist in grid: for i in range(0,self.columns-1): cell = ['-'] sublist.append(cell) def printGrid(self): for sublist in self.grid: print sublist def … | |
Hey, so for a project of mine we are asked to draw a face using instances of classes. I'm not very familiar with classes and I was wondering if anyone could explain to me why my code wont even open the turtle window. I'm also slightly confused as to how … | |
In my programming class, we need to write a program where the user is prompted for a value. Once that value is provided, the program is supposed to multiply its digits. For example: if the user typed 1234, it would multiply 1*2*3*4 and give the answer. I'm not sure how … |