wxy1718011 发表于 2021-3-28 20:05:56

哪种乘法表代码更好


i,j=1,1
while i<10:
    while j<10:
      print(i,'*',j,'=',j*i,sep='',end=' ')
      j+=1
    print()
    i+=1
    j=i



i=1
while i<10:
    j=1
    while j<i+1:
      print(j,'*',i,'=',j*i,end=' ')
      j+=1
    print()
    i+=1

wp231957 发表于 2021-3-28 21:16:57

都不好,应该用for循环的,大约④到五行代码

wxy1718011 发表于 2021-3-28 23:42:21

wp231957 发表于 2021-3-28 21:16
都不好,应该用for循环的,大约④到五行代码

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAakAAABaCAYAAAACXalYAAAWF0lEQVR4Ae2dy48kR53H449BmNaMp7sHz2xPDvPsmeru6R739Ex3Yy8vGUFZ7IJBPDQsJ7QsNw4lLmAkpNWOsbFPnEryhZX3IdlHtLa00BKyxImDL/wDPxTPjIiMyIx8VWVWfy2NKysz8he/+ER2fOsXERnBPv2pNbp96y69/vrrhP9AAARAAARAYEgEGERqSNUBX0AABEAABGwCbO1Ta3Tn5h1EUjYVHIMACIAACAyCALvw3AW6feM2RGoQ1QEnQAAEQAAEbALs0mcu0HadManfZ0RPWf7vQ9vcYo/PZhkxxohN5+0y1mV6q6Wddl4M/+75lBib0rApzWnKGLV9JIZfGfAQBM4HAXbpM2t0/852WiT14ZToaUb012HA0SKVzc7aOaRF6vct7bTzYth3n80oY4xirHVdtP3BUGlHCCWTP04i/mgbEKphP1LwDgRSCLD159ZocjdRpN5iRLNZil2kWSkCMjoJCpARrznNshZRbYodJVBGfMw9xR8XUqiGHvWt1EOCwoBALwTYxnNrtHP3XlokxUUKXWK9VMSQjcYbfC5eGclA9qyFSKXYCdufTxmxbEZFmSoR1iHDhm8gAAIOAXZ5bY0e3J90I1K620yPWfmCxrsLRSQ2z8e0eNq641pel0/wF75TzMgX0X1pja/5/vKmb8aIeDegXbYm0eScRxof0Cd0RnM2o5n6N/cGeD6ZPTPXRJqp3fx+Qh9kM3o2+4ScdMKuW8azaZ6Hzot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qEDzeBAAiAAAj0SYCt3/1nmhxNIVJ9UoZtEAABEACBRgTY+r3XaOfxNyBSjfDhJhAAARAAgT4JsM29H9DO8TchUn1Shm0QAAEQAIFGBNj63g9p8gQi1YgebgIBEAABEOiVANvY/xFNTl5DJNUrZhgHARAAARBoQoBdPvwxTU6/A5FqQg/3gAAIgAAI9EqArR/+hCYvfQ8i1StmGAcBEAABEGhCgL1w+FPa+fz3IVJN6OEeEAABEACBXgmwzf0f084pIqleKcM4CIAACIBAIwJ/ByJVcWCWXgTEAAAAAElFTkSuQmCC
页: [1]
查看完整版本: 哪种乘法表代码更好