English feliratok

← Improving Code Quality - Programming Foundations with Python

Beágyazókód kérése
6 Languages

Showing Revision 4 created 05/25/2016 by Udacity Robot.

  1. So I made a few changes to the code, see
  2. if you agree with them. In the draw square function,
  3. I now use a loop, and this loop does my
  4. repetitive tasks, tasks like move the turtle forward and turn it
  5. right, and this loop runs 4 times. Then I created
  6. a new function called draw art, in this function I
  7. create the window screen. This is the screen that has
  8. the background color as red, and then I create my first
  9. turtle, which I named brad. I change brad's shape,
  10. color and speed, and then I call the draw square
  11. function, so that I can actually draw my first
  12. square. After that, I create my second turtle, angie. And
  13. here are angie shape and color, and then angie
  14. draws a circle. And then towards the end, I call
  15. the draw_art function which is right here. So let
  16. me go ahead and save, and run this program to
  17. make sure everything is running fine. And there's our two
  18. turtles. One drawing a square, the other one drawing a circle.