python-initial print and input functions

Source: Internet
Author: User
You can press the shortcut key CTRL + N in the Python shell to create a new *.py script, save it,
The Run→run module on the file is executed, and the results are displayed in the Python shell,
or type the name or Python name directly under your command line.

Python Output statement print function

print () Formatted output
  • Print (Format (val, format_modifier))
  • Val: Value
  • Format_modifier: Format Word

Precision: Take a few digits after the decimal point

Output placeholder: The total number of digits

When the output occupies a small amount, the left-aligned output and output occupy a lot of time, right-aligned output

Print numbers with a% number

Small details:
Print Prints multiple characters:
Print x, y

Example of the input function


python-initial print and input functions

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.