Unit 1 - Creating drawings:
Monday, November 23, 2020 9:13 AM
Section 1.1 The basics:
Sub-section 1.1.2 - Position and size:
Coding:
Rectangle code: Rect(10,20,30,40)
Lesson 2 - The canvas:
- (0, 0) is the left-top corner of the canvas (no
middle!).
- As x increases, you head right.
- As y increases, you head down, not up!
- Our canvas is a 400x400 square, so (200, 20
middle of the canvas, and (400, 400) is the
corner.
- We use Rect to draw a rectangle. We provid
after that: left, top, width, and height.
Lesson 5 - Errors:
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, wi
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.
Lesson 6 - Comments:
Did you notice some of the code examples above included # signs followed by Englis
These are called comments. You can add comments to any line of your code. Anythin
# sign to the end of that line is a comment. Python ignores comments. They are only f
not Python. So why use comments? To make your code easier for you and for others t
understand!
Section 1.2 Colours: Lesson 1 - Fills:
Subsection 1.2.1 - Fills and borders: When using fill, here are s
Fill code: Rect(50, 50, 100, 100, fill=“green”)
- Include fill after the
arguments -- left, top
- Always place an equ
color name.
- Put quotes around th
can use either single
double quotes, like “
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller studystar9touni. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $7.67. You're not tied to anything after your purchase.