zoukankan      html  css  js  c++  java
  • 编程练习

    绘制五角星
    import turtle turtle.setup(600,350,200,200)#起始位置 turtle.pensize(2)#画笔大小 turtle.pencolor("black")#画笔颜色 turtle.fillcolor("red")#填充颜色 turtle.begin_fill() for i in range(5): turtle.forward(200)#前进距离 turtle.right(144)#右转角度 turtle.end_fill()

     

    绘制六角星import turtle
    
    turtle.left(30)#左转角度
    turtle.forward(144)#前进距离
    
    turtle.right(60)
    turtle.forward(144)
    
    turtle.right(60)
    turtle.forward(144)
    
    turtle.right(60)
    turtle.forward(144)
    
    turtle.right(60)
    turtle.forward(144)
    
    turtle.right(60)
    turtle.forward(144)
    
    turtle.forward(144)
    turtle.right(120)
    turtle.forward(144)
    
    turtle.left(60)
    turtle.forward(144)
    turtle.right(120)
    turtle.forward(144)
    
    turtle.left(60)
    turtle.forward(144)
    turtle.right(120)
    turtle.forward(144)
    
    turtle.left(60)
    turtle.forward(144)
    turtle.right(120)
    turtle.forward(144)
    
    turtle.left(60)
    turtle.forward(144)
    turtle.right(120)
    turtle.forward(144)
    
    turtle.left(60)
    turtle.forward(144)
    turtle.right(120)
    turtle.forward(144)
    
    turtle.exitonclick()
    

      

    绘制叠边三角形
    import turtle turtle.pensize(5) turtle.pencolor("black") turtle.seth(0)#改变角度 turtle.fd(200) turtle.seth(120) turtle.fd(200) turtle.seth(240) turtle.fd(200) turtle.seth(0) turtle.fd(100) turtle.seth(60) turtle.fd(100) turtle.seth(180) turtle.fd(100) turtle.seth(300) turtle.fd(100) turtle.d
     

      

  • 相关阅读:
    android中src和background区别
    html标签大全
    android横竖屏切换时activity的生命周期
    onInterceptTouchEvent和onTouchEvent调用时序
    Android Activity单例
    Android dispatchTouchEvent
    android 2D API相关
    杭电 1085 Holding BinLaden Captive!
    杭电 1715 大菲波数
    杭电 1492 The number of divisors(约数) about Humble Numbers
  • 原文地址:https://www.cnblogs.com/leeing/p/12463044.html
Copyright © 2011-2022 走看看