- looping graphics – add this line just above calling a function:
for loop in range (25):
- plotting graphics – follow this outline for successfully plotting graphics
- any good program starts with a solid plan – use the provided graph paper to plot your design
- each thick line is 100 pixels, each thin line is 25 pixels
Your custom graphic must use:
1. comments (put a hashtag in front of comment) to tell what is happening in that section of code
3. multiple colors
4. your own work
Want to add more? – add a background gif
screen.bgpic(“sky.gif”)#this is the name of your file – mine was called sky.gif
tech news – this is the Swiss Army knife of action cameras
- functions -saving time
- calling multiple functions
- using IDLE, click on File, New File and write a program that creates a square. Use the code below to get you started:
- a function can save you all that typing/copy-pasting
- function structure:
4. working with two turtles – can it be done? Yes. Ideas?
5. your work today – create custom art using Turtle using multiple functions and colors. Comment your work to explain what happens in each section. Comments starts a #.
Massive list of Python Turtle commands and code
-writing a program in shell vs a Python file
-programing a custom shape with line and fill colors
- Open IDLE, open shell
- Type in these lines in the Python shell:
- Add your own lines and make a square. HINT: what do you repeat to make a square? Did you get errors? Check the code for spelling and punctuation. Try again.
- Now…File, New.
- Enter the same lines into your new file to make a square.
- Save your file and watch it run. DON’T NAME YOUR FILE TURTLE. You can name it newturtle, newshape, etc.
- What’s the variable?
- Adding color:
- Fill the shape with color.
- Create shapes of your own design.
Resources and tips:
CTRL-S to save
F5 to run (also asks you to save)
Python color chart
Welcome to Computer Programming!
Happy Birthday to #!
- class review
- class survey
- why Python?
- beginning with Python