联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2018-05-04 09:09

1 Define the drawsquare function and draw the image shown below. Assume each side is 40 pixels. (Hint: notice that the turtle has already moved away from the ending point of the last square when the program ends.)

2 Write a function drawPoly(somesides, somesize) which makes a turtle draw a regular polygon. When called with drawPoly(8, 50), it will draw a shape like this:

3 The two spirals in this picture differ only by the turn angle. Draw both.


4 Write a function sumTo(n) that returns the sum of all integer numbers up to and including n. So sumTo(10) would be 1+2+3...+10 which would return the value 55. Use the equation (n * (n + 1)) / 2.


5 Write a function to draw a five pointed star, where the length of each side is 100 units. Use the function you defined to draw five stars, but between each, pick up the pen, move forward by 350 units, turn right by 144, put the pen down, and draw the next star. You’ll get something like this (note that you will need to move to the left before drawing your first star in order to fit everything in the window):


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp