Python Automation-day02

Source: Internet
Author: User

1.python is an object-oriented, interpreted computer language;

Writing code to help you test, system development in the language, and we do automation in the language does not matter.

Crawler, data analytics, web development, AI, automated operations, automated testing, embedded, hacking

2. Explanatory and compiled languages

Compiled languages
Once the compilation runs everywhere, compile the code before running it. And then run, the compilation time is longer (c,c+,c++)

Interpreted language
Run the time to compile, run a compilation. Run efficiently without a compiled language fast (python, Ruby, Shell, Java. class JVM)

Single quotes, double quotes, and three quotation marks (three single quotes) in 3.python
Python in the definition of variables when the strings are enclosed in quotation marks, single and double quotation marks no difference, with anything, if there is a single quotation mark inside the string, then you use double quotation marks inside, there are double quotation marks, the outside with single quotation marks, if there are both single and double, then use three quotation marks, Three quotation marks can also be multiline comment code, single-line comment, use #

4. Conditional judgment

The conditional judgment in Python uses if else to judge, multi-branch words using if elif ... else

5. Cycle:while,or

While loop before, first judge once, if the condition is satisfied, then loop,

The For loop must have an iterative object in order to loop, for example, to have an array, and to loop directly in Python to take the value of the list.

There are two more important keywords in the loop, continue and break

Continue means, jump out of this loop and proceed to the next loop.

Break means to stop the loop.

Which means that the code under continue and break is not executed.

6. Formatted output

With placeholders, there are three commonly used placeholders, and%s,%d, and%f,%s are followed by a string, and%d is followed by a value that must be an integer,%f followed by a decimal.

7. Arrays

Python Automation-day02

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.