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 sys
import turtle
from turtle import *
sys.argv
def draw_star(n):
turtle.begin_fill()
for i in range(5):
turtle.forward(n)
turtle.right(144)
turtle.end_fill()
def mygoto(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()
turtle.bgcolor(‘red‘)
turtle.color(‘yellow‘)
turtle.fillcolor(‘yellow‘)
turtle.setup(600,400,120,120)
turtle.hideturtle()
mygoto(-250,75)
draw_star(80)
turtle.right(50)
mygoto(-140,150)
draw_star(30)
turtle.left(50)
mygoto(-110,100)
draw_star(30)
mygoto(-110,40)
draw_star(30)
turtle.left(50)
mygoto(-140,-10)
draw_star(30)
turtle.done(