Python基础

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()

posted on 2018-03-15 12:31  paosons  阅读(90)  评论(0编辑  收藏  举报

导航