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

    from turtle import *
    
    
    def draw(x):
        begin_fill()
        for i in range(5):
            forward(x)
            right(144)
        end_fill()
    
    def go_to(x,y):
        up()
        goto(x, y)
        down()
    
    if __name__ == "__main__":
        setup(600, 100, 0, 0)
        bgcolor('red')
        color('yellow')
        fillcolor('yellow')
        go_to(-220, 75)
        draw(100)
        for i in range(4):
            x = 1
            if i in [0,3]:
                x = 0
            go_to(-100+x*50, 150-i*40)
            left(15-i*15)
            draw(30)
    go_to(0, 0)
    hideturtle()

    url = "http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html"
    print(url[-14:-5])
    url = "http://news.gzcc.cn/html/xiaoyuanxinwen/{}.html"
    for i in range(230):
        if i == 1:
            print(url.format(index))
        else:
            print(url.format(i))
    def get_num(url):
        print(url[-14:-5])
    if __name__=="__main__":
        url = "http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html"
        get_num(url)
    str = ''快乐池塘栽种了梦想就变成海洋
    鼓的眼睛大嘴巴同样唱的响亮
    借我一双小翅膀就能飞向太阳
    我相信奇迹就在身上
    啦......
    有你相伴 leap frog
    啦......
    自信成长 有你相伴 leap frog
    快乐的一只小青蛙 leap frog
    快乐的一只小青蛙 leap frog
    (rap)快乐的池塘里面有只小青蛙
    它跳起舞来就像被王子附体了
    酷酷的眼神,没有哪只青蛙能比美
    总有一天它会被公主唤醒了
    啦...... leap frog
    啦...... leap frog
    它是一只小跳蛙 越过蓝色大西洋
    跳到遥远的东方 跳到我们身旁
    春夏秋冬 我们是最好的伙伴
    亲吻它就会变得不一样
    啦......
    变变变 leap frog
    啦......
    自信成长 有你相伴 leap frog
    啦......
    有你相伴 leap frog
    啦......
    自信成长 有你相伴 leap frog
    快乐的一只小青蛙 leap frog
    快乐的一只小青蛙 leap frog
    sub = '小青蛙'
    print(str.count(sub))
  • 相关阅读:
    对每项物品,找出最贵价格的物品的经销商
    每项物品的的最高价格是多少?
    找出最贵物品的编号、销售商和价格
    查数据库有哪些表、查数据库
    取某字段不为空的数据is not null
    mysql匹配模式
    找出包含正好5个字符的名字
    要想找出正好包含5个字符的名字
    要想找出包含“w”的名字
    要想找出以“y”结尾的名字
  • 原文地址:https://www.cnblogs.com/SCJX/p/8604986.html
Copyright © 2011-2022 走看看