Python basic content

Source: Internet
Author: User

1. Comments

#单行注释

' Multiline comment '

2. Variables

Python has no procedure for declaring a variable (dynamic type)

Variable name = value, if the float is defined as a floating-point type, if the integer is defined as an integer, if the string is defined as a string

3. Input and output

Input and output of the console

Print (output content), X=input ("Prompt")

4. operator and table = expression

Mathematical operations:

+

-

*

/floating-point division

Integer division

* * Power operation

% take-up

Comparison operation:

>

<

>=

<=

<> also means not equal to

!=

==

Logical operation:

Not

and

Or

Assignment operation:

=

5. Process Control

Condition control

An IF condition expression:

Code executed when the condition is true

Else

Code executed when the condition is false

ESIF is an abbreviation for else if

Python basic content

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.