Python Learning-Exercises (8)

Source: Internet
Author: User
"" "Title: Output 9*9 multiplication table. "" "Def Answer1 ():" "    in the most common double loop to output    : return:" ""    print ("Output One:") for    I in range (1):        For j in range (1, i + 1):            print ("%d x%d =%2s"% (i, J, I * j), end= "  ")        print () answer1 () def answer2 ():    The "" "    while loop, with another formatting    note for print percent (%) formatted output, sets the output format for the flag with%, and the fomate format is formatted with a colon (:) to set the string format for the flag    : return: "" "    print (" Output two: ")    i = 1 while    i <:        j = 1 while        j <= I:            print (" {} x {} ={:2} ". Format (i, J, I * j), end= "  ")            j + = 1        print ()        i + = 1answer2 ()

  

Python Learning-Exercises (8)

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.