zoukankan      html  css  js  c++  java
  • Python基础综合练习

    from turtle import *
    turtle.setup(600, 400, 10, 10)
    turtle.bgcolor('red')
    turtle.hideturtle()
    turtle.speed(10)
    turtle.pencolor('yellow')
      
    def draw(chang):
        turtle.fillcolor('yellow')
        turtle.begin_fill()
        for i in range(5):
            turtle.forward(chang)
            turtle.right(144)
        turtle.end_fill()
      
    def gotopen(x,y):
        turtle.penup()
        turtle.goto(x,y)
        turtle.pendown()
      
    gotopen(-250,110)
    draw(110)
      
    gotopen(-100,160)
    turtle.right(-15)
    draw(40)
      
    gotopen(-60,120)
    turtle.right(0)
    draw(40)
      
    gotopen(-60,80)
    turtle.right(15)
    draw(40)
      
    gotopen(-100,40)
    turtle.right(30)
    draw(40)
      
    turtle.done

     

    取得校园新闻的编号:

    a = "http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html"
    a=a.rstrip(".html")
    a=a[-9:]
    print(a)

    产生python文档的网址:

    def strCat(html,x):
        b=html[:-11]
        c=html[-5:]
        d=b+x+c
        print(d)
    
        
    strCat("https://docs.python.org/3/library/turtle.html","intro")

    产生校园新闻的一系列新闻页网址:

    a = "http://news.gzcc.cn/html/xiaoyuanxinwen/4.html"
    b=a[:-6]
    c=a[-5:]
    for i in range(5):
        d=""
        d=b+str(i)+c
        print(d)
  • 相关阅读:
    多表模型
    母版,单表操作,双下划线模糊查询
    模板层
    视图层
    路由层
    orm
    浅谈cookie,sessionStorage和localStorage区别
    实现元素垂直居中的方法(补充)
    实现元素垂直居中的方法
    <a href="javascript:;"></a>
  • 原文地址:https://www.cnblogs.com/wban48/p/8604314.html
Copyright © 2011-2022 走看看