我写过
class Spillebrett:
def __init__ (self, rader, kolonner):
self._rader=rader
self._kolonner=kolonner
self._rutenett=[[]]
generasjon=0
generer()
def generer(self):
for i in range(self._rader):
for j in range(self._kolonner):
但是我得到了
NameError: name 'generer' is not defined
进一步定义,我该怎么做?
答案 0 :(得分:2)
请将generer()
更改为self.generer()