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):
画国旗代码
import turtle def mygoto(x,y): turtle.up() turtle.goto(x,y) turtle.down() def draw(r): turtle.begin_fill() for i in range(5): turtle.forward(r) turtle.right(144) turtle.end_fill() turtle.setup(600, 400) turtle.color("yellow") turtle.bgcolor("red") turtle.fillcolor("yellow") mygoto(-250,75) drawsatr(90) mygoto(-110,150) drawsatr(40) mygoto(-70,100) drawsatr(40) mygoto(-70,50) drawsatr(40) mygoto(-110,0) drawsatr(40) turtle.hideturtle() turtle.done()