Python output multiplication table with while printout

Source: Internet
Author: User

Read a lot of on-line multiplication formula printing, feel a lot of writing is not suitable for beginners to understand, today reference a few small examples, wrote this small script, hope to learn the novice look at this, understand Python in the while statement will have some help.

I wrote each line to help see, you can directly copy a piece of code to run, the content or there are so many aspects, directly put the code here.

#encoding =GBK
‘‘‘
The code is declared as GBK, because it is running under Windows, and I mentioned the previous article about Python

Code problem,
‘‘‘

x=1# initial one variable x
While x<=9: #判断x小于等于9
y=1# initial one variable y
While y<=x: #确定y的循环次数, less than or equal to X
Print y, ' * ', x, ' = ', y*x, ', #格式化打印输出
y=y+1# counter
print# printing line, preceded by a comma separated, without this line of code is connected to a piece.
Another counter on the x=x+1# perimeter
Raw_input () #让窗口打印玩了不关闭

This article is from the "Sailing It Tribe" blog, make sure to keep this source http://yhitbl.blog.51cto.com/3955073/1543662

Python output multiplication table with while printout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.