用python写的九九乘法表
时间: 2023-05-11 10:01:56 浏览: 64
python编写九九乘法表源码
Sure, here's the code for a simple Python program that prints out the multiplication table for numbers 1 through 9:
```
for i in range(1, 10):
for j in range(1, i+1):
print(f"{j} x {i} = {i*j}", end="\t")
print()
```
This program uses nested loops to iterate over the numbers 1 through 9 and print out the multiplication table for each number. The `range()` function is used to generate the sequence of numbers to iterate over, and the `print()` function is used to output the results to the console.
阅读全文