The role of Python full stack development day3 variable

Source: Internet
Author: User

Variable:

Variables are stored in order to store some intermediate results in the process of program operation, in order to facilitate later invocation.

Cases:

Print ("Hello world!")

Print ("Alon")

Print ("alon_x")

Name = ("alon_x")

X=3

Y=4

Z=x*y

Print ("X*y", Z)

Print ("z=", Z)

The code format must be aligned, or it will be an error. indentationerror:unexpected indent ("Hi, man, your file is not in the right format, it may be the tab and space is not aligned, you need to check the tab and the Space ")

Defines the value of x, y to give Z records the result of the operation Z is convenient to call the result Z.

    1. Naming rules for variables
    2. To have a descriptive
    3. Variable names can only be underlined _, numbers, and letters, not special characters.
    4. Cannot use Chinese as a variable name
    5. Cannot start with a number or a space
    6. Reserved characters are not allowed to be used

Constants: Constants that are constant, such as ππ=3.1415926 ....

All variables in Python are mutable, so all uppercase variable names are used in Python to represent the secondary variable as constant

The role of Python full stack development day3 variable

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.