Staging
v0.5.1
https://github.com/python/cpython
Revision 3daf0017de56ec1a5d61f5ff833d63dc3ca35278 authored by Miss Islington (bot) on 10 July 2020, 15:50:45 UTC, committed by GitHub on 10 July 2020, 15:50:45 UTC
(cherry picked from commit 6fc732a2116e2c42b0431bb7e2a21719351af755)

Co-authored-by: marload <rladhkstn8@gmail.com>
1 parent 51b36ed
Raw File
Tip revision: 3daf0017de56ec1a5d61f5ff833d63dc3ca35278 authored by Miss Islington (bot) on 10 July 2020, 15:50:45 UTC
Fix typo in docs: 'created by th' -> 'created by the' (GH-21384)
Tip revision: 3daf001
peace.py
#!/usr/bin/env python3
"""       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
"""

from turtle import *

def main():
    peacecolors = ("red3",  "orange", "yellow",
                   "seagreen4", "orchid4",
                   "royalblue1", "dodgerblue4")

    reset()
    Screen()
    up()
    goto(-320,-195)
    width(70)

    for pcolor in peacecolors:
        color(pcolor)
        down()
        forward(640)
        up()
        backward(640)
        left(90)
        forward(66)
        right(90)

    width(25)
    color("white")
    goto(0,-170)
    down()

    circle(170)
    left(90)
    forward(340)
    up()
    left(180)
    forward(170)
    right(45)
    down()
    forward(170)
    up()
    backward(170)
    left(90)
    down()
    forward(170)
    up()

    goto(0,300) # vanish if hideturtle() is not available ;-)
    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()
back to top