
CMU CS Academy 2.2.4 and 2.2.5
Presentation
β’
Computers
β’
9th - 12th Grade
β’
Practice Problem
β’
Easy
Maria Cruz Farooqi
Used 3+ times
FREE Resource
2 Slides β’ 10 Questions
1
CMU CS Academy 2.2.4 and 2.2.5
Variables and Mouse Release Events
By Maria Cruz Farooqi
βLearning Target:
I can identify and utilize global and local variables to modify the properties of a shape in a graphical program.
I can use Python to change shapes when I release the mouse and explain what happens when I press and release the mouse in different ways.
2
Drag and Drop
3
Multiple Choice
How can we be sure that there are 2 circles after we click the mouse in the previous example?
We cannot. There is no way to tell.
The Inspector shows one point with two colors.
Both a red and a blue circle are clearly visible.
The circle is purple, because it combines blue and red.
4
Dropdown
5
Dropdown
See how the circle β
6
Dropdown
Unlike local variables, global variables can be used anywhere, inside or outside any function. That is why we can use c inside β
7
Multiple Choice
Which variables are local, and which are global, in the previous example?
x and y are local, and c is global.
They are all local.
They are all global.
c is local, and x and y are global.
8
Drag and Drop
onMouseRelease
When you press the mouse down, eventually you stop β9
Dropdown
10
Multiple Choice
In the previous example, what happens if you press the mouse and immediately release it (without moving it)? Try it first before answering.
We get two circles -- a navy circle drawn directly over a gold circle.
The code crashes if we do that.
We get only one circle -- the gold circle becomes navy.
There is no way to tell if we have one or two circles.
11
Dropdown
12
βYour Turn: Go to CMU CS Academy and finish the lessons, Checkpoints, and Exercises.
CMU CS Academy 2.2.4 and 2.2.5
Variables and Mouse Release Events
By Maria Cruz Farooqi
βLearning Target:
I can identify and utilize global and local variables to modify the properties of a shape in a graphical program.
I can use Python to change shapes when I release the mouse and explain what happens when I press and release the mouse in different ways.
Show answer
Auto Play
Slide 1 / 12
SLIDE
Similar Resources on Wayground
8 questions
HTML Tables
Lesson
β’
9th - 12th Grade
11 questions
INTERNET 101: WIRES, CABLES & WIFI
Lesson
β’
9th - 12th Grade
9 questions
Logarithms
Lesson
β’
9th - 12th Grade
10 questions
Surface Area
Lesson
β’
9th - 12th Grade
10 questions
Grammar and Punctuation Review #1
Lesson
β’
9th - 12th Grade
8 questions
Mastering Parameters
Lesson
β’
9th - 12th Grade
10 questions
K.3 Safety in My Online Neighborhood
Lesson
β’
KG
10 questions
8.4.1 Lesson 1
Lesson
β’
9th - 12th Grade
Popular Resources on Wayground
10 questions
5.P.1.3 Distance/Time Graphs
Quiz
β’
5th Grade
10 questions
Fire Drill
Quiz
β’
2nd - 5th Grade
20 questions
Equivalent Fractions
Quiz
β’
3rd Grade
15 questions
Hargrett House Quiz: Community & Service
Quiz
β’
5th Grade
20 questions
Main Idea and Details
Quiz
β’
5th Grade
20 questions
Context Clues
Quiz
β’
6th Grade
20 questions
Inferences
Quiz
β’
4th Grade
15 questions
Equivalent Fractions
Quiz
β’
4th Grade