Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 OPStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started