zoukankan      html  css  js  c++  java
  • 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()

      

  • 相关阅读:
    Redis的发布订阅
    Redis的事物
    Redis的持久化
    Redis配置文件详解
    Redis五大数据类型
    Redis安装
    DP练习题回顾
    基环树浅谈
    Tarjan算法浅谈
    拓展欧拉定理浅谈
  • 原文地址:https://www.cnblogs.com/wha000/p/8569673.html
Copyright © 2011-2022 走看看