0
0
Blockchain / Solidityprogramming~15 mins

Ethereum networks (mainnet, testnet) in Blockchain / Solidity - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Ethereum Networks: Mainnet and Testnet
📖 Scenario: You are learning about Ethereum blockchain networks. Ethereum has a main network called Mainnet where real transactions happen with real money. It also has Testnets where developers test their smart contracts and applications without using real money.In this project, you will create a simple program to store and display information about Ethereum networks.
🎯 Goal: You will build a small program that stores Ethereum network names and their descriptions. Then, you will select a network type and display its details.
📋 What You'll Learn
Create a dictionary with Ethereum network names and their descriptions
Create a variable to select a network name
Use a loop or conditional to find and store the selected network's description
Print the selected network's name and description
💡 Why This Matters
🌍 Real World
Developers use Ethereum testnets to safely test smart contracts and decentralized apps before deploying them on the mainnet where real money is involved.
💼 Career
Understanding Ethereum networks is essential for blockchain developers, testers, and anyone working with decentralized applications to avoid costly mistakes.
Progress0 / 4 steps
1
Create the Ethereum networks dictionary
Create a dictionary called eth_networks with these exact entries: 'mainnet': 'The main Ethereum network with real transactions.', 'goerli': 'A popular Ethereum testnet for testing smart contracts.', 'sepolia': 'Another Ethereum testnet used for development and testing.'
Blockchain / Solidity
Need a hint?

Use curly braces {} to create a dictionary. Each entry has a key and a value separated by a colon.

2
Select the Ethereum network to display
Create a variable called selected_network and set it to the string 'goerli' to choose the Goerli testnet.
Blockchain / Solidity
Need a hint?

Assign the string 'goerli' to the variable selected_network.

3
Get the description of the selected network
Create a variable called network_description and set it to the description of the network stored in selected_network from the eth_networks dictionary.
Blockchain / Solidity
Need a hint?

Use the selected_network variable as a key to get the value from eth_networks.

4
Display the selected network and its description
Write a print statement to display the selected network name and its description in this exact format: "Network: goerli - A popular Ethereum testnet for testing smart contracts."
Blockchain / Solidity
Need a hint?

Use an f-string to combine the selected_network and network_description in the print statement.