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


    from turtle import  *
    
    
    def mygoto(x,y):
       up()
       goto(x,y)
       down()
    
    def mygoto(x,y):
       up()
       goto(x,y)
       down()
    
    def mystar(x):
        begin_fill()
        for  i in range(5):
            forward(x)
            right(144)
        end_fill()
    
    setup(700,500,0,0)
    bgcolor("red")
    fillcolor("yellow")
    color('yellow')
    hideturtle()
    # 隐藏画笔
    
    mygoto(-300,150)
    mystar(100)
    mygoto(-190,220)
    mystar(45)
    mygoto(-140,150)
    mystar(45)
    mygoto(-140,90)
    mystar(45)
    mygoto(-190,40)
    mystar(45)
    
    done()
    

    for i in range(2, 229):
        print(i)
        url = "http://news.gzcc.cn/html/xiaoyuanxinwen/{}.html"
        for i in range(1,230):
            if i == 1:
                print(url.format('index'))
            else:
                print(url.format(i))
    

     

    a = '     hello!python!哈!哈!哈   '
    print(a.strip(), '\n ---------------------')
    print(a.lstrip(), '\n---------------------')
    print(a.rstrip(), '\n---------------------')
    print(a.count('!'), '\n---------------------')
    print(a.split('!'))
    

    str = '''Hey Jude, don't make it bad.
    Take a sad song and make it better.
    Remember to let her into your heart,
    Then you can start to make it better.
    Hey Jude, don't be afraid.
    You were made to go out and get her.
    The minute you let her under your skin,
    Then you begin to make it better.
    And anytime you feel the pain, hey Jude, refrain,
    Don't carry the world upon your shoulders.
    For well you know that it's a fool who plays it cool
    By making his world a little colder.
    Hey Jude, don't let me down.
    You have found her, now go and get her.
    Remember to let her into your heart,
    Then you can start to make it better.
    So let it out and let it in, hey Jude, begin,
    You're waiting for someone to perform with.
    And don't you know that it's just you, hey Jude, you'll do,
    The movement you need is on your shoulder.
    Hey Jude, don't make it bad.
    Take a sad song and make it better.
    Remember to let her under your skin,
    Then you'll begin to make it
    Better better better better better better, oh.
    na na na, na na na na, na na na, hey Jude
    na na na, na na na na, na na na, hey Jude..'''
    sub = 'na'
    print(str.count(sub))
    

     

  • 相关阅读:
    【完结】php+MySQL实战案例【九】总结及源码分享
    php+MySQL实战案例【八】用户注册
    php+MySQL实战案例【七】数据编辑、删除
    php+MySQL实战案例【六】数据分页查询
    php+MySQL实战案例【五】新增用户
    php+MySQL实战案例【四】管理员登录
    php+MySQL实战案例【三】数据表设计
    php+MySQL实战案例【二】php数据库辅助类
    5700清空所有配置的方法
    华为设备默认console密码
  • 原文地址:https://www.cnblogs.com/piglet00/p/8599737.html
Copyright © 2011-2022 走看看