Python Case 008 (99 multiplication table)

Source: Internet
Author: User

Two-tier data nesting


#!/usr/bin/python
#-*-coding:utf-8-*-"" "
print (9 9)  --> multiplication Table

"
"for X in range (1,10):
    print with
    K in range (1,x+1):   # does not miss the range function
        print '%d *%d =%s '% (x,k , str (x*k). Ljust (3)), # If don't want to line feed, need the ' comma at the end of the line ' "
How to fill the two-digit local data with two Bit..
1 * 1 = 1
2 * 1 = 2   2 * 2 = 4
3 * 1 = 3   3 * 2 = 6   3 * 3 = 9
4 * 1 = 4   4 * 2 = 8
 4 * 3 =  4 * 4 =
5 * 1 = 5   5 * 2 = ten  5 * 3 =  5 * 4 = 5  * 5 =
6 * 1 =  6   6 * 2 =  6 * 3 = 6  * 4 = 6  * 5 =  6 * 6 =
7 * 1 = 7   7 * 2 =  7 * 3 =  7 * 4 =  7 * 5 = 7  * 6 = 7  * 7 = 8
* 1 = 8   8 * 2 = 8  * 3 = 24
 8 * 4 =  8 * 5 =  8 * 6 = 8  * 7 = 8  * 8 = 9
* 1 = 9   9 * 2 = 9  * 3 = 2 7  9 * 4 =  9 * 5 = 9  * 6 = si  9 * 7 =  9 * 8 = 9  * 9 *
+ = Bayi "" "


Related Article

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.