ยปCore Development>Code coverage>Lib/turtledemo/yinyang.py

Python code coverage for Lib/turtledemo/yinyang.py

#countcontent
1n/a#!/usr/bin/env python3
2n/a""" turtle-example-suite:
3n/a
4n/a tdemo_yinyang.py
5n/a
6n/aAnother drawing suitable as a beginner's
7n/aprogramming example.
8n/a
9n/aThe small circles are drawn by the circle
10n/acommand.
11n/a
12n/a"""
13n/a
14n/afrom turtle import *
15n/a
16n/adef yin(radius, color1, color2):
17n/a width(3)
18n/a color("black", color1)
19n/a begin_fill()
20n/a circle(radius/2., 180)
21n/a circle(radius, 180)
22n/a left(180)
23n/a circle(-radius/2., 180)
24n/a end_fill()
25n/a left(90)
26n/a up()
27n/a forward(radius*0.35)
28n/a right(90)
29n/a down()
30n/a color(color1, color2)
31n/a begin_fill()
32n/a circle(radius*0.15)
33n/a end_fill()
34n/a left(90)
35n/a up()
36n/a backward(radius*0.35)
37n/a down()
38n/a left(90)
39n/a
40n/adef main():
41n/a reset()
42n/a yin(200, "black", "white")
43n/a yin(200, "white", "black")
44n/a ht()
45n/a return "Done!"
46n/a
47n/aif __name__ == '__main__':
48n/a main()
49n/a mainloop()