Python 99 multiplication table

Source: Internet
Author: User

Use the idle to play the multiplication table, want to be like the result:

The implementation algorithm is simple, but the idle (python3.7) default line-wrapping output is not easy to implement, it takes a lot of brains.

The code is as follows:

The *row=0, the 1, the 1th row, is the value of the time.???????????

While True:

? ? Print ("\ n")???????????? #为特殊输出格式设的换行语句

? ? N=0, 1 is the value of 1x=y.??????????

? ? Row=row+1?????????

? ? If row==10:????????????? #row最高设到9

? ? ? ? Break

? ? While N<row:???????????? #控制输出个数, the first few lines output a few data

? ? ? ? N=n+1

? ? ? ? C=n? Row

? ? ? ? D=STR (n) + "X" +str (row) + "=" +str (c) #编花

? ? ? ? Print (d+ "?) ", end= ')??????? #输出内容, end=", special statement, do not allow default line wrapping *

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

Post-run effects

Honey See, say this 8,864, 8,972 of I also will ah. I said but I just use these lines of code to achieve this, and you can only say 9,981, and I am here 1000, even to 10,000 of the multiplication can have, and I just need to move a few fingers, finish me? If row==10:10 change to 1000, run, see Fullscreen's determinant constantly rolling

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? .....

I said, look, this is called technology, automation ... Honey: No talking.


Python 99 multiplication table

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.