我最近开始学习 python(来自 C++ 背景),但我不明白我应该如何访问成员变量 ( nonce) 并在名为def mine_block().
class Block:
'''
Дефинираме ф-я , която създава
променливите като членове на класа Block
'''
def _init_(self,prevHash,index,nonce,data,hash,time):
self.prevHash = prevHash
self.index = index
self.nonce = nonce
self.data = data
self.hash = hash
self.time = time
def get_hash(self):
print(self.hash)
def mine_block(self,difficulty):
arr = []
for i in range(difficulty):
arr[i] = '0'
arr[difficulty] = '\0'
str = arr
while True:
'''
here I receive an error
unresolved referene nonce
'''
nonce++
ITMISS
相关分类