
U2L1-2 Review ^^
Presentation
•
Computers
•
9th - 10th Grade
•
Medium
TIFFANY WONG
Used 10+ times
FREE Resource
7 Slides • 9 Questions
1
U2L1-2 Review ^^
Presented by kaufwong©
2
Multiple Select
Which of the following are GLOBAL variables? Choose one or more.
3
Global vs. Local Variables
A global variable is one that ALL sprites and scripts can access.
shopping list is a global variable. The sprites "add," "clear," and "delete" all access shopping list and make changes to it.
4
Global vs. Local Variables
A local variable is limited to the scope in which its defined.
In other words, secret number can ONLY be used in the definition of number guessing game.
If you try to use secret number outside of number guessing game, you'll get an error.
5
More on local variables
We use local variables because using global variables sometimes makes it difficult to debug.
Having too many global variables also clutters our variable palette...
So when you're wondering if it should use a global or local variable, ask: do multiple scripts/sprites need to use it??
vs
6
Multiple Select
Which of the following are LOCAL variables? Choose one or more.
7
More on local variables
Yes, input variables are also local!
They cannot be used outside of the procedure in which they are defined.
8
Fill in the Blanks
Type answer...
9
Fill in the Blanks
Type answer...
10
Multiple Select
In which of the following instances should you use global variables instead of local variables? Choose one or more.
Keeping track of a player's score throughout an event-based game with many different triggers
Making an abstraction called "pythagorean thm" that takes in two numbers and calculates the third side
Making an app that manages a to-do list with various sprites as buttons that each have a different feature
Counting the number of times the user makes a guess, but the variable is used only in this script
11
Variables vs Lists
A list can hold more than one value at a time, and the values are ordered. A variable can only hold one value at a time.
Shopping list app is very hard to do with just variables :(
You don't know how many variables you need to create because you need one for every item the user will add (and who knows how many they'll add!). A list is better because it can hold as many values as the user wants to add.
12
Multiple Choice
Running which of the following scripts will result in shopping list being an empty list?
13
Multiple Select
Running which of the following scripts will make the sprite say "0" ? Choose one or more.
14
Multiple Choice
shopping list = [eggs, milk, bread]. Which of the following will make shopping list [eggs, milk, cheese, bread] ?
15
The index of an item in the list refers to its order in the list.
shopping list = [eggs, milk, bread]
The first item, eggs, is at index 1
The length of the list refers to the number of items inside.
We want [eggs, milk, cheese, bread]
add adds items to the end, i.e. append in pseudocode
16
Multiple Choice
The delete blocks takes in a number and a list as inputs. Which of the following scripts will delete bread from the shopping list?
U2L1-2 Review ^^
Presented by kaufwong©
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
13 questions
Storage Devices
Presentation
•
10th Grade
13 questions
Sentence Variety Practices
Presentation
•
9th - 10th Grade
10 questions
K.3 Safety in My Online Neighborhood
Presentation
•
KG
12 questions
Ch 5-1 Intro to Solving Systems of Equations with Graphing
Presentation
•
9th - 10th Grade
11 questions
INTERNET & INTRANET
Presentation
•
9th Grade
10 questions
บทเรียนวิชาคอมพิวเตอร์พื้นฐาน
Presentation
•
KG
11 questions
Teenager 5 Session 22: Pronunciation & Speaking
Presentation
•
KG
11 questions
Volume of Prisms and Cylinders
Presentation
•
9th - 10th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Assessment 2
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
12 questions
2026 TAP Technology in the Classroom
Presentation
•
Professional Development
15 questions
HCS SCI 05 Summer School Assessment 2 Review
Quiz
•
5th Grade
15 questions
HCS SCI 04 Summer School Review 2
Quiz
•
4th Grade
59 questions
Geometry Unit 3 Review
Quiz
•
9th - 12th Grade
14 questions
FAST ELA READING SMAPLE TEST MATERIALS
Passage
•
3rd Grade