O'Reilly logo

Scratch by Example: Programming for All Ages by Eduardo A. Vlieg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Eduardo A. Vlieg 2016
Eduardo A. VliegScratch by Example10.1007/978-1-4842-1946-1_8

8. Variables

Eduardo A. Vlieg
(1)
Curacao, Curaçao
 
To temporarily hold information and pass it to other blocks in your script, you can create variables. Each variable you create in Scratch has a unique name and can hold either a numeric value or a string of characters. A string can be an actual word or any combination of letters, numbers, and symbols, like in a password. For example, you could create a variable called City and give it the value Boston. Later in your script, you can set City to another value, such as New York. Variables come in handy whenever you need to use data values that change in a script. For example, suppose that you wanted the cat to count ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required