Pycharm开发环境设置与熟悉。
练习基本输入输出:
print('你好,{}.'.format(name))
uprint(sys.argv)
库的使用方法:
import ...
from ... import ...
条件语句:
if (abs(pos()))<1:
break
循环语句:
for i in range(5):
while True:
函数定义:
def mygoto(x,y):
def drawjx(r):
综合练习:画一面五星红旗,将代码与运行截图发布博客交作业。
from turtle import * def mygoto(x,y): up() goto(x,y) down() setup(600,400,0,0) color('yellow') bgcolor('red') fillcolor('yellow') mygoto(-250,75) begin_fill() for i in range(5): forward(100) right(144) end_fill() mygoto(-100,150) begin_fill() for i in range(5): forward(50) right(144) end_fill() mygoto(-50,100) begin_fill() for i in range(5): forward(50) right(144) end_fill() mygoto(-50,50) begin_fill() for i in range(5): forward(50) right(144) end_fill() mygoto(-100,0) begin_fill() for i in range(5): forward(50) right(144) end_fill() done()