
CMU CS Python Rectangles, Colors and borders.
Presentation
•
Computers
•
9th - 12th Grade
•
Easy
Maria Cruz Farooqi
Used 3+ times
FREE Resource
4 Slides • 11 Questions
1
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
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
14 questions
Legacy of Corruption
Presentation
•
9th - 12th Grade
10 questions
České státní symboly
Presentation
•
9th - 12th Grade
8 questions
Digital Health Technology
Presentation
•
9th - 12th Grade
15 questions
Finding Zeros of a Function Lesson
Presentation
•
9th - 12th Grade
10 questions
LOGICA MATEMÁTICA
Presentation
•
9th - 12th Grade
11 questions
Pythagorean Theorem
Presentation
•
9th - 11th Grade
11 questions
MATERI PASCAL : REPEAT UNTIL
Presentation
•
10th - 12th Grade
11 questions
P-T Diagram Group Practice
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade