0
0
Blockchain / Solidityprogramming~10 mins

Public vs private blockchains - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a public blockchain property.

Blockchain / Solidity
blockchain_type = '[1]'
Drag options to blanks, or click blank then click option'
Aprivate
Bcentralized
Cpublic
Dpermissioned
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'private' or 'permissioned' which restrict access.
2fill in blank
medium

Complete the code to check if a blockchain is private.

Blockchain / Solidity
if blockchain_type == '[1]':
    access = 'restricted'
Drag options to blanks, or click blank then click option'
Aprivate
Bpublic
Copen
Ddecentralized
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'public' which means open access.
3fill in blank
hard

Fix the error in the code to correctly identify a public blockchain.

Blockchain / Solidity
def is_public(chain):
    return chain == '[1]'
Drag options to blanks, or click blank then click option'
Aprivate
Bclosed
Cpermissioned
Dpublic
Attempts:
3 left
💡 Hint
Common Mistakes
Checking for 'private' or 'permissioned' which are restricted.
4fill in blank
hard

Fill both blanks to create a dictionary showing blockchain types and their access.

Blockchain / Solidity
blockchain_access = {
    'public': '[1]',
    'private': '[2]'
}
Drag options to blanks, or click blank then click option'
Aopen
Brestricted
Cclosed
Dpermissioned
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'open' and 'restricted' values.
5fill in blank
hard

Fill all three blanks to complete the function that returns blockchain access type.

Blockchain / Solidity
def get_access_type(blockchain):
    if blockchain == '[1]':
        return '[2]'
    else:
        return '[3]'
Drag options to blanks, or click blank then click option'
Apublic
Bopen
Crestricted
Dprivate
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping access types or blockchain names.