• 99乘法表


    def table():
        for i in range (10,0,-1):
           for j in range(i,10):
              print("%s * %s = " %(i,j),i*j,end=', ')
           print()# print("
    ")==print('
    ')==print(''或“”)
    
    def table1():
        for i in range (1,10):
           for j in range(i,10):
              print("%s * %s = %s " %(i,j,i*j),end=', ')
           print()# print("
    ")==print('
    ')==print(''或“”)
    
    def table2():
       for i in range(1,10):
           for j in range(1, i+1):
               print("%s * %s = %s " % (j, i, i * j), end=', ')
           print()  # print("
    ")==print('
    ')==print(''或“”)
    if __name__=='__main__':
        table()
        print()
        table1()
        print()
        table2()
    

      上述展示了自己的99乘法表的基本情况,肯定还有改进空间,是以记录。

    此外,参考网友的如下:

    def table():
    for i in range (10,0,-1):
    for j in range(i,10):
    print("%s * %s = " %(i,j),i*j,end=', ')
    print()# print(" ")==print(' ')==print(''“”)

    def table1():
    for i in range (1,10):
    for j in range(i,10):
    print("%s * %s = %s " %(i,j,i*j),end=', ')
    print()# print(" ")==print(' ')==print(''“”)

    def table2():
    for i in range(1,10):
    for j in range(1, i+1):
    print("%s * %s = %s " % (j, i, i * j), end=', ')
    print() # print(" ")==print(' ')==print(''“”)
    if __name__=='__main__':
    table()
    print()
    table1()
    print()
    table2()
  • 相关阅读:
    巡风安装配置 -windows
    Struts2-052 RCE CVE-2017-9805
    CVE-2017-12615和CVE-2017-12616
    Nmap使用指南
    理解HTTP协议
    缓慢拒绝服务攻击- slowloris.pl
    SSL&TLS渗透测试
    Nmap版本检测
    Protocol Buffer学习教程之编译器与类文件(三)
    64位Windows系统下32位应用程序连接MySql
  • 原文地址:https://www.cnblogs.com/Li-JT/p/12844706.html
Copyright © 2020-2023  润新知