For while turtle pensizewidth turtle pencolorred turtle fillcolorred

  • Slides: 13
Download presentation

For语法 while语法

For语法 while语法

参考代码:画笔控制 turtle. pensize(width) 画笔大小 turtle. pencolor(’red’) 画笔颜色 turtle. fillcolor(’red’) 图形的填充颜色 turtle. begin_fill() 准备开始填充图形 turtle.

参考代码:画笔控制 turtle. pensize(width) 画笔大小 turtle. pencolor(’red’) 画笔颜色 turtle. fillcolor(’red’) 图形的填充颜色 turtle. begin_fill() 准备开始填充图形 turtle. end_fill() 填充完成 turtle. clear() 清屏 turtle. write(s, font=(“font写文本,s为文本内容,font是字体的参数, name”, font_size, ”font_type”)) 里面分别为字体名称,大小和类型 font=('arial', 8, 'normal')

代码优化:一朵小红花 • 如何上色? – turtle. fillcolor(’red’) – turtle. begin_fill() – turtle. circle(-20) – turtle.

代码优化:一朵小红花 • 如何上色? – turtle. fillcolor(’red’) – turtle. begin_fill() – turtle. circle(-20) – turtle. end_fill() 'lightcoral' 'darkorange' 'gold' 'palegreen' 'paleturquoise' 'skyblue' 'plum' 'hotpink' 'pink'