Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

Mr. Kao's Lesson

star
star
star
star
star
Last updated over 6 years ago
12 Nsɛmmisa

SWBAT: Write psuedocode for and then modfiy existing code to meet the required graphics output using the Python turtle module.

1
1
1
1
1
1
1
1
1
1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

Choose all that apply: Is Python a(n)

Asemmisa {{asɛmmisaAhyɛnsode}}
2.

What are examples of Python functions or syntax that can produce the illustration in the video below?

Asemmisa {{asɛmmisaAhyɛnsode}}
3.

If you selected "other" above, what other code would you use?

Asemmisa {{asɛmmisaAhyɛnsode}}
4.

Run the code below using the "play" button. What does the line: "turtle.right(90)" do to make the graphics drawing program draw a square?

Asemmisa {{asɛmmisaAhyɛnsode}}
5.

If the turtle.right() orients the turtle object by rotating it some number of degrees, then modify the code above to make the program draw a triangle. What number of degrees do you need to specify for the turtle.right() function? (hint: it has to do with the measure of the external angle of a triangle)

Asemmisa {{asɛmmisaAhyɛnsode}}
6.

Modify the code again to draw a pentagon and a hexagon and paste the code for both in the space below. Refer to the table above if you need help.

Asemmisa {{asɛmmisaAhyɛnsode}}
7.

Answer both questions in the space below:

How do you work out the angle if you know the number of sides?

Complete the equation below (which should calculate angle in terms of sides):

angle = ______ ÷ sides

Asemmisa {{asɛmmisaAhyɛnsode}}
8.

What is the best choice for pseudocode for lines 2 - 4 in the code above?

Asemmisa {{asɛmmisaAhyɛnsode}}
9.

If you can only modify the constant integers in lines 2 - 4 marked in the loop above, which is NOT possible?

Asemmisa {{asɛmmisaAhyɛnsode}}
10.

What is the best pseudocode to use in line 9 above?

Asemmisa {{asɛmmisaAhyɛnsode}}
11.

Finish writing the pseudocode for lines 8 to 10 in the code above.

Asemmisa {{asɛmmisaAhyɛnsode}}
12.

Modify the code above to create the shape shown. This can be done with only a few lines of code.

Try playing with these Trinkets to experiment with more code using Turtle!

https://trinket.io/library/trinkets/bcc17929f5

https://hourofpython.trinket.io/a-visual-introduction-to-python#/welcome/an-hour-of-code