python 用while語句打印99乘法表


# coding:utf-8

# form_future_import print_function    //在python2中引入python3中print函數的語法的語句





# 1.總共有9列
# 2.每行中的列數,就是當前的行號
# 3.乘式的第一個數代表得是列,第二個數代表行
row = 1
column = 1

while row <= 9:
	while column <= row:
		print('%d*%d=%d '%(column,row,column*row),end='') # end=''//表示不讓換行
		column += 1	
	print('')
	column = 1
	row += 1

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM