python3.x the print () function default parameter

Source: Internet
Author: User

Beginner Python, wrote a 99 multiplication table,

For I in range (1, 10):

For j in range (1, i+1):

Print (J, ' X ', I, ' = ', j*i,,end= ' \ t ')

Print (' \ n ')


Here end= ' \ t ' means to end with tab

The end parameter is not known at first, so the line is automatically wrapped and the second line is output each time one line is finished

>>> Help (print)

Help on built-in function print in module Builtins:


Print (...)

Print (value, ..., sep= ', end= ' \ n ', File=sys.stdout, Flush=false)

Prints the values to a stream, or to Sys.stdout by default.

Optional keyword arguments:

File:a File-like Object (stream); Defaults to the current sys.stdout.

Sep:string inserted between values, default a space.

End:string appended after the last value, default a newline.

Flush:whether to forcibly flush the stream.

Sep indicates that the value and value are separated by a space by default, and end is the default newline


In addition in the Python2. x, simply add a comma after print to

python3.x the print () function default parameter

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.