Question: Why am I getting the error return computed_hash ^ SyntaxError: 'return' outside function available available @staticmethod def proof_of_work(self, block): Function that tries different values of

Why am I getting the error

return computed_hash

^

SyntaxError: 'return' outside function

Why am I getting the error return computed_hash ^ SyntaxError: 'return' outside

available available @staticmethod def proof_of_work(self, block): Function that tries different values of nonce to get a hash that satisfies our difficulty criteria. block.nonce = 0 computed_hash = block.compute_hash() Variable explorer Help Plots Files while not computed_hash.startswith('@'*Blockchain.difficulty): O Console 1/A block.nonce += 1 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 computed_hash = block.compute_hash() return computed_hash jupyter_client.jsonutil, jupyter_client.adapter, spyder, spyder.pil_patch, PIL, PIL. _version, PIL. Image, PIL. ImageMode, PIL.TiffTags, PIL._binary, PIL._util, PIL._imaging, cffi, cffi.api, cffi.lock, cffi.error, cffi.model File "C: blockchain line 79 return computed_hash def add_new_transaction(self, transaction): self.unconfirmed_transactions.append(transaction) A def mine(self): SyntaxError: 'return' outside function if not self.unconfirmed_transactions: IPdb [40]: return false last_block = self.last_block OP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!