python中输出一个九九乘法表


second = 1
while second <= 9:
first = 1
while first <= second:
print("%d * %d =%2d " % (first, second, first * second)),# python2.7版本不换行输出格式,3.0版本为 print("%d * %d =%d " % (first, second, first * second), end=(""))

        first = first + 1 
print("")
second += 1


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM