# -*- coding:cp936 -*- def multiTable(): """ 题目:输出9*9口诀。 程序分析:分行与列考虑,共9行9列,i控制行,j控制列。 注意:print自带换行,print后面加逗号可以不换行。 """ for firNum in range(1, 10): for secNum in range(1, firNum+1): print "%d * %d = %d" % (firNum, secNum, firNum*secNum), print if (__name__ == '__main__'): multiTable()