0
0
Blockchain / Solidityprogramming~10 mins

Why dApps need user interfaces in Blockchain / Solidity - Test Your Understanding

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

Complete the code to display a simple message in a dApp UI.

Blockchain / Solidity
console.log([1]);
Drag options to blanks, or click blank then click option'
A"Welcome to the dApp!"
BWelcome to the dApp!
Cconsole.log
Dalert
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the message text.
2fill in blank
medium

Complete the code to create a button element in HTML for a dApp UI.

Blockchain / Solidity
<button>[1]</button>
Drag options to blanks, or click blank then click option'
Asubmit
B<button>
Cdiv
DClick me
Attempts:
3 left
💡 Hint
Common Mistakes
Putting HTML tags inside the button instead of text.
3fill in blank
hard

Fix the error in the JavaScript code that updates a dApp UI element.

Blockchain / Solidity
document.getElementById('status').[1] = 'Connected';
Drag options to blanks, or click blank then click option'
AinnerHTML
Bvalue
Cconsole
DgetElementById
Attempts:
3 left
💡 Hint
Common Mistakes
Using value instead of innerHTML for div or span elements.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.

Blockchain / Solidity
{word: [1] for word in words if [2] > 3}
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
Dword.length
Attempts:
3 left
💡 Hint
Common Mistakes
Using word instead of len(word) for length.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values only if value is positive.

Blockchain / Solidity
result = [1]: [2] for k, v in data.items() if [3] > 0
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Dk
Attempts:
3 left
💡 Hint
Common Mistakes
Using k instead of k.upper() for keys.
Checking k instead of v in condition.