Complete the code to check if an address is an Externally Owned Account (EOA).
if len(address.code) == [1]: print("This is an EOA.")
An EOA has no code, so its code length is 0.
Complete the code to send Ether from an EOA to another address.
tx = {
'from': sender,
'to': receiver,
'value': [1]
}The 'value' field must be the amount of Ether in wei to send.
Fix the error in the code that tries to call a contract function from an EOA.
contract = web3.eth.contract(address=contract_address, abi=contract_abi)
result = contract.functions.[1]().call()You must call the actual function name defined in the contract ABI.
Fill both blanks to create a dictionary comprehension that maps EOAs to their balances if balance is greater than 0.
balances = {addr: [1] for addr in addresses if [2] > 0}Use web3.eth.get_balance(addr) to get the balance for each address and filter those with balance > 0.
Fill all three blanks to create a dictionary comprehension that maps contract addresses to their code size if code size is greater than zero.
contract_codes = {addr: len([1]) for addr in contract_addresses if len([2]) [3] 0}Use web3.eth.get_code(addr) to get the contract code and check if its length is greater than zero.