5/5
## Workshop Challenge We've gotten pretty far into our code. Now is a great time to pause and try a challenge. Can you get the `list_of_numbers` to return 8, and the `list_of_people` to return Wong instead of 0? **Hint:** You might have to add something to the contract, and then interact with the contract. **Pause the video and try to figure this out!** ## Solution If your strategy was to just call `add_person` with Wang and 8 a bunch of times, that would work. We'll try that. ```bash add_person Wang 8 ``` We'll click `add_person` a few times here, and it looks like we are just spamming it! Oh, we've filled up the array! Now the index is too much. Well, now we're stuck with a list of people that just says `8 Wong` for every single person. This is definitely one way to do it, but it's not very elegant. We'll look at other, more effective ways to do this in future lessons.
A fun workshop to test your Vyper knowledge. The challenge requires you to modify a Vyper smart contract to return a specific value based on an array of people and their corresponding numbers.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
The basics of blockchain transactions, how to send and receive money on a blockchain network.
How to write Python based smart contracts using Vyper.
How to read and understand Vyper smart contracts.
Vyper data structures, arrays, structs, hash maps.
How to build a smart contract application and deploy on ZKsync with Moccasin.
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on May 29, 2025
Duration: 2h 08min
Duration: 2h 32min
Duration: 24min
Course Overview
About the course
The basics of blockchain transactions, how to send and receive money on a blockchain network.
How to write Python based smart contracts using Vyper.
How to read and understand Vyper smart contracts.
Vyper data structures, arrays, structs, hash maps.
How to build a smart contract application and deploy on ZKsync with Moccasin.
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on May 29, 2025