（首页）开始编程之旅 翻译自Lee Harr的Start Programming

# 1. StartProgramming-1-9 练习Exercises

1. Play the practice.py game to get used to moving the penguin around. Read the comments at the start of the file to see how to play. (Hint)
2. You made pete move in a square. Now make him go in a rectangle that is twice as wide as it is high. (Hint)
3. Now see if you can make pete go in a triangle. (Hint)
4. Use a variable distance to make pete walk in a square or triangular spiral. (Hint)
5. Make two different loops -- one to draw a pentagon and one to draw a five-pointed star. (Hint)
6. Turn exercise 4 in to both a for loop and a while loop. (Hint)
7. Create functions for triangle and pentagon like we made for square. Make the functions take a parameter for the length of a side. (Hint)
8. Create a function which takes a sequence of strings and writes them around the edges of a polygon with one side for each string. (Hint)
9. Create a function which takes a sequence of strings and writes each one on a separate line, one above the next. (Hint)

StartProgramming-1-9 (last edited 2009-12-25 07:13:54 by localhost)

• Page.execute = 0.623s
• getACL = 0.482s
• init = 0.013s