我试图从一个类中调用一个@staticmethod方法来初始化一个类变量,如下所示: class Test: def get_bit_count():但是,下面的代码运行得很好: class Test: def get_bit_count(): num = Nonedef __init__(self):
print(
attributes: a_number"""
print "You've initialized a Question!"def myself_add(self, new_number):在类定义下面的__main__函数中,我正在运行代码
my_qmust be called with Question instance as first argu