One, the use of knowledge points:
1. Use of variables.
2. Use of circular statements, here is a double while loop. Of course, it's also possible to use other loops to do it. I think the use of a double while loop is easier to understand for people who have just come into contact with programming.
3. Use the line break "\ n" and the tab "\ T" to make the output more beautiful
Second, the code:
1 Print("\ n"+"From top to bottom")2 3A1 = 14 5 whileA1 <= 9:6A2 = 17 whileA2 <=A1:8 Print(STR (A2) +"*"+STR (A1) +"="+str (A1*A2), end ="\ t")9a2 = a2 + 1Ten Print() Onea1 = A1 + 1 A - Print("######################################################################\n") - the Print("From bottom to top") - -A3 = 9 - + whileA3 >0: -a4 = 1 + whileA4 <=A3: A Print(str (A4) +"*"+STR (A3) +"="+str (A3*A4), end ="\ t") ata4 = A4 +1 - Print("") -A3 = A3-1
Third, the effect output:
Python3 multiplication table (top to bottom + from bottom to top)