turtle shapesize()
时间: 2023-11-12 16:08:38 浏览: 38
As an AI language model, I don't have the capability to display graphics or execute Python commands directly. However, I can provide you with some information about the `shapesize()` method in Python's turtle module.
`shapesize()` is a turtle method that sets the size of the turtle shape. It takes three arguments: `stretch_wid`, `stretch_len`, and `outline`.
The `stretch_wid` argument specifies the stretch factor for the turtle shape's width. The default value is 1, which means no stretching. A value greater than 1 stretches the shape horizontally, and a value less than 1 compresses it.
The `stretch_len` argument specifies the stretch factor for the turtle shape's length. The default value is 1, which means no stretching. A value greater than 1 stretches the shape vertically, and a value less than 1 compresses it.
The `outline` argument specifies the width of the turtle shape's outline. The default value is 1.
Here's an example of using `shapesize()` to set the size of a turtle shape:
```
import turtle
t = turtle.Turtle()
t.shape("turtle")
t.shapesize(2, 2, 3)
```
This code creates a turtle object, sets its shape to "turtle", and uses `shapesize()` to stretch the width and length of the turtle shape by a factor of 2 and set the outline width to 3.