Pycharm开发环境设置与熟悉

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 picture(x1,y1,x,y):
    turtle.up()
    turtle.goto(x1, y1)
    turtle.down()
#这个比较重要,用于填充颜色 turtle.begin_fill() turtle.fillcolor(
"yellow") for i in range(5): turtle.forward(x) turtle.left(y) turtle.end_fill() # 速度为6 turtle.speed(6)
# 背景为红色 turtle.bgcolor(
"red")
# 画笔的颜色 turtle.color(
"yellow") picture(-300,200,100,144) picture(-80,260,60,144) picture(-100,180,60,144) picture(-120,100,60,144) picture(-200,50,60,144) # 防止自动关闭 turtle.done()

 

 

 

posted @ 2018-03-14 20:01  166黄仲浩  阅读(222)  评论(0编辑  收藏  举报