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

    综合练习:画一面五星红旗,将代码与运行截图发布博客交作业。

    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)
    
    mygoto(-140,150)
    draw_star(30)
    
    mygoto(-110,100)
    draw_star(30)
    
    mygoto(-110,40)
    draw_star(30)
    
    mygoto(-140,-10)
    draw_star(30)
    
    turtle.done()

  • 相关阅读:
    AOD.net
    C# Eval()和Bind()
    .Net使用微軟自帶的用戶驗證和登錄授權
    .Net面試4套
    .Net面試題
    MVC开发模式
    .Net自帶Ajax和GridView
    HTML系列(HTMl+CSS+JavaScript+Jquery)--un
    .Net母版页
    .NetDOM操作--un
  • 原文地址:https://www.cnblogs.com/ffde/p/8569605.html
Copyright © 2011-2022 走看看