Python basics 1 and python Basics

Source: Internet
Author: User

Python basics 1 and python Basics

Variable: Information stored, called, modified, or operated in the future

Constant: Fixed amount, all uppercase letters

Naming rules:

Note:

#: Comment on a single line

"Or ''': multi-line comment

Get user input: Input ("")

Strong conversion:Str (integer type) # convert Integer type to string type

Int (string accepted) # convert string type to integer type

Arithmetic Operator:

+ -*/! // (Take the entire division) %

Comparison Operators: Each comparison is actually a condition judgment, and a True or False value is obtained accordingly.

<,>, <=, >=, = ,! =

Assignment operator:

=, + =,-=, * =, % =, // =, ** =

Logical operators:Logical operators are used for logical computing. They are expressions or variables used for conditional judgment.

Not: If the expression is True, the returned result is False. Otherwise, the returned result is True.

And: returns True if both expressions are True. If one expression is False, return false.

Or: If either expression is True, the return result is True.

Expression:An expression is a code or statement consisting of operands and operators. An expression can be evaluated and placed on the right of "=" to assign values to variables.

 

 

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.