美文网首页
笨方法学python-练习8-更多更多打印

笨方法学python-练习8-更多更多打印

作者: Demoary | 来源:发表于2017-02-11 16:52 被阅读0次

    练习8-更多更多打印

    • 更多打印

    更多打印

    # -*- coding:utf-8 -*-
    formatter = "%r %r %r %r"
    print formatter % (1, 2, 3, 4)
    print formatter % ("one", "two", "three", "four")
    print formatter % (True, False, False, True)
    print formatter % (formatter, formatter, formatter, formatter)
    print formatter % (
        "I had this thing.",
        "That you could type up right.",
        "But it didn't sing.",
        "So I said goodnight."
    )
    

    运行结果

    PS F:\python大师\习题> python .\ex8.py
    1 2 3 4
    'one' 'two' 'three' 'four'
    True False False True
    '%r %r %r %r' '%r %r %r %r' '%r %r %r %r' '%r %r %r %r'
    'I had this thing.' 'That you could type up right.' "But it didn't sing." 'So I said goodnight.'
    PS F:\python大师\习题> 
    

    相关文章

      网友评论

          本文标题:笨方法学python-练习8-更多更多打印

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