美文网首页
作业day3

作业day3

作者: 木偶演员 | 来源:发表于2018-07-18 20:35 被阅读0次

    作业

    2.3
    people_name = "DaWei"
    print("Hello "+people_name+",would you like to learn some Python today?")

    2.4
    print("小写:"+people_name.lower())
    print("大写:"+people_name.upper())
    print("首字母大写:"+people_name.capitalize())

    2.5
    name="dafei"
    str1=""做店长的话,我的店不打烊,做船长的话,我的船不靠岸.""
    print(name+"曾说:"+str1)

    2.6
    famous_people=name
    message=str1
    print(famous_people+"今天说"+message)

    2.7
    name1 = "888888dafei666666"
    print(name1.lstrip("8"))
    print(name1.rstrip("6"))
    print(name1.strip("8"))

    答案

    2.3
    Hello DaWei,would you like to learn some Python today?

    2.4
    小写:dawei
    大写:DAWEI
    首字母大写:Dawei

    2.5
    dafei曾说:"做店长的话,我的店不打烊,做船长的话,我的船不靠岸."

    2.6
    dafei今天说"做店长的话,我的店不打烊,做船长的话,我的船不靠岸."

    2.7
    dafei666666
    888888dafei
    dafei666666
    [Finished in 0.1s]

    相关文章

      网友评论

          本文标题:作业day3

          本文链接:https://www.haomeiwen.com/subject/useapftx.html