Complete the code to define a public blockchain property.
blockchain_type = '[1]'
The code sets the blockchain type to 'public', which means anyone can join and participate.
Complete the code to check if a blockchain is private.
if blockchain_type == '[1]': access = 'restricted'
The condition checks if the blockchain is 'private', which means access is restricted.
Fix the error in the code to correctly identify a public blockchain.
def is_public(chain): return chain == '[1]'
The function returns True if the chain is 'public', meaning open to all.
Fill both blanks to create a dictionary showing blockchain types and their access.
blockchain_access = {
'public': '[1]',
'private': '[2]'
}Public blockchains have 'open' access, private blockchains have 'restricted' access.
Fill all three blanks to complete the function that returns blockchain access type.
def get_access_type(blockchain): if blockchain == '[1]': return '[2]' else: return '[3]'
The function returns 'open' for public blockchains and 'restricted' for others (private).