
CMU CS Python Rectangles, Colors and borders.
Presentation
•
Computers
•
9th - 12th Grade
•
Easy
Maria Cruz Farooqi
Used 2+ times
FREE Resource
4 Slides • 11 Questions
1
CMU CS Academy
Replace this with a sub-header that can be in multiple lines.
Duplicate this text as many times as you would like.
2
The Canvas
To understand what is going on, we first have to talk about the canvas. In this course, all drawing is done on a canvas.
The canvas is made up of tiny colored points, or pixels. We use (x,y) coordinates to talk about pixels on the canvas, like so:
(0, 0) is the left-top corner of the canvas (not the middle!).
As x increases, you head right.
As y increases, you head down, not up!
Our canvas is a 400 x 400 square, so (200, 200) is the middle of the canvas, and (400, 400) is the right-bottom corner.
3
As x increases, you head right.
As y increases, you head down, not up!
Our canvas is a 400 x 400 square, so (200, 200) is the middle of the canvas, and (400, 400) is the right-bottom corner.
(200, 200)
(400, 400)
4
Multiple Choice
Which one is near (0, 0) ?
A
B
C
D
5
Multiple Choice
Which one is near (400, 0) ?
A
B
C
D
6
Multiple Choice
Which one is near (400, 200) ?
A
B
C
D
7
Multiple Choice
Which one is near (400, 400) ?
A
B
C
D
8
Python is very picky. Here are some rules to follow:
Case matters, so Rect is not the same as rect.
A command must have the right number of values after it.
For Rect, that's left, top, width, and height. These values are called arguments. Here are some rules about arguments:
They must be in the right order.
They must be inside parentheses.
They must be separated by commas.
If any of these rules are not followed, you have an error, and your code will not run correctly until you fix the error.
9
Drag and Drop
10
Drag and Drop
Rect (0,200,100,200)
Rect (200,200, 200,200)
11
Drag and Drop
12
Multiple Choice
The order in which we draw shapes matters. Each new shape is drawn on top of all the previous shapes. Which code is in the correct order?
Rect(0, 0, 100, 100, fill='orange')
Rect(50, 50, 100, 100, fill='lime')
Rect(50, 50, 100, 100, fill='lime')
Rect(0, 0, 100, 100, fill='orange')
13
Multiple Choice
The order in which we draw shapes matters. Each new shape is drawn on top of all the previous shapes. Which code is in the correct order?
Rect (40,20,160,160, fill="dodgerBlue")
Rect(120,100,160,200, fill="lightGreen")
Rect (200,220,160,160, fill="dodgerBlue")
Rect(0,0,400,400,fill="lightSalmon")
Rect(0,0,400,400,fill="lightSalmon")
Rect (40,20,160,160, fill="dodgerBlue")
Rect(120,100,160,200, fill="lightGreen")
Rect (200,220,160,160, fill="dodgerBlue")
14
Drag and Drop
15
Dropdown
CMU CS Academy
Replace this with a sub-header that can be in multiple lines.
Duplicate this text as many times as you would like.
Show answer
Auto Play
Slide 1 / 15
SLIDE
Similar Resources on Wayground
11 questions
Social Media Marketing
Presentation
•
9th - 12th Grade
10 questions
Cinco de mayo
Presentation
•
9th - 12th Grade
12 questions
Momentum and Impulse
Presentation
•
10th - 12th Grade
14 questions
พีทาโกรัส
Presentation
•
9th - 12th Grade
13 questions
Speed v. Velocity
Presentation
•
8th Grade
10 questions
Matematika Volume Kubus dan Balok
Presentation
•
10th - 11th Grade
11 questions
Typography - Create a Business Card Setup
Presentation
•
10th - 12th Grade
14 questions
CMU CS Academy 2.1.5 Exercises
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
"What is the question asking??" Grades 3-5
Quiz
•
1st - 5th Grade
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
Discover more resources for Computers
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
10 questions
Fire Prevention
Quiz
•
9th - 12th Grade
24 questions
BIOLOGY STAAR REVIEW
Quiz
•
9th Grade
50 questions
STAAR English 2 Review
Quiz
•
10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
30 questions
English 1 STAAR Review
Quiz
•
9th Grade