Balance checking
📖 Scenario: You are building a simple blockchain wallet app. Users have balances stored in a dictionary. You want to check how much balance each user has.
🎯 Goal: Create a program that stores user balances, sets a minimum balance threshold, finds users with balances above that threshold, and prints their names and balances.
📋 What You'll Learn
Create a dictionary called
balances with exact user names and balancesCreate a variable called
min_balance with the exact value 100Use a dictionary comprehension called
rich_users to select users with balances greater than min_balancePrint the
rich_users dictionary exactly as shown💡 Why This Matters
🌍 Real World
Blockchain wallets need to check user balances to show available funds or to decide if a user can make a transaction.
💼 Career
Understanding how to filter and display balances is important for blockchain developers working on wallet apps or financial dashboards.
Progress0 / 4 steps