Python の基礎: 九九

Python の基礎: 九九

0から15までの九九。
Python コード:-
#multiplication table from 0 to 15
 print(" ",end="")
 for i in range(16):
 print("%5d|"%i, end="")

print()
 print("______" * 17)

for i in range(16):
 print("%5d|"%i, end="")

for j in range(16):
 print("%5d|"%(i*j), end="")

print()

出力:-
ここに画像の説明を挿入します

おすすめ

転載: blog.csdn.net/qq_37270421/article/details/133255867