File "", line 1, in Player1 = Player(0, 500) TypeError: __init__() takes exactly 2 arguments (3 given)
我知道这是最常见的错误之一,但是 我无法解决它。谢谢你的帮助
类Player.py
class Player(object):
def __init__(self, Pos, Stack):
self.Pos = Pos
self.Stack = Stack
def cstack(self, change):
self.Stack += change
主要代码Go.py
from Player import Player
Table=list()
Player1 = Player(0, 500)
Player2 = Player(1, 500)
Player3 = Player(2, 500)
Player1.cstack(30)
print Player3.Stack