0
0
Blockchain / Solidityprogramming~30 mins

Why handling value is core to blockchain - See It in Action

Choose your learning style9 modes available
Why Handling Value is Core to Blockchain
📖 Scenario: Imagine you want to send digital money to your friend without using a bank. Blockchain helps you do this safely and clearly by handling the value (money) directly between you and your friend.
🎯 Goal: Build a simple program that shows how blockchain handles value by recording transactions between people.
📋 What You'll Learn
Create a list of transactions with sender, receiver, and amount
Add a variable to track the minimum amount to record
Use a loop to filter transactions above the minimum amount
Print the filtered transactions showing value handled
💡 Why This Matters
🌍 Real World
Blockchain is used to securely transfer money or assets without banks. Handling value correctly is key to trust and transparency.
💼 Career
Understanding how value is handled in blockchain helps in jobs like blockchain developer, financial software engineer, and security analyst.
Progress0 / 4 steps
1
Create the initial list of transactions
Create a list called transactions with these exact dictionaries: {'sender': 'Alice', 'receiver': 'Bob', 'amount': 50}, {'sender': 'Bob', 'receiver': 'Charlie', 'amount': 30}, {'sender': 'Alice', 'receiver': 'David', 'amount': 70}
Blockchain / Solidity
Need a hint?

Use a list with dictionaries inside. Each dictionary has keys 'sender', 'receiver', and 'amount'.

2
Add a minimum amount filter
Create a variable called min_amount and set it to 40 to filter transactions with amounts greater than or equal to this value
Blockchain / Solidity
Need a hint?

Just create a variable named min_amount and set it to 40.

3
Filter transactions by minimum amount
Create a list called filtered_transactions using a list comprehension that includes only transactions from transactions where the amount is greater than or equal to min_amount
Blockchain / Solidity
Need a hint?

Use a list comprehension to pick transactions where the amount is at least min_amount.

4
Print the filtered transactions
Write a print statement to display the filtered_transactions list
Blockchain / Solidity
Need a hint?

Use print(filtered_transactions) to show the result.