Search⌘ K
AI Features

Edward Can Remember!

Explore how variables function as named memory containers in Python to store data such as numbers and text. Understand variable assignment, naming conventions, and how to print and update variable values. This lesson helps you grasp the concept of memory in programming through practical examples with Edward the robot.

We saw that Edward can communicate with us by printing information of each block in his path. As he moves to a new block and we click the print_info() button, it prints the state of that block.

Edward with memory

With all the features that he has, is he even aware of what he can do? Once he moves on to a new block, does he remember whether he already potted a plant or removed trash before? He has no way of knowing it! He can’t remember if he has even done any work. If he had a way to store this information somewhere, he would have a purpose. Say, he knows he needs to pot at least one plant and remove trash. But right now he can’t know if he has already done that or not.

So how about we program Edward to remember as well? It would be like giving Edward the ability to memorize.

Look at the widget below, where we see a block called ...