011day--python Basic Knowledge

Source: Internet
Author: User

One, Python type

Compile-and-interpret

Compiled type:

Pros: Compilers typically have pre-compiled procedures to optimize code. Because the compilation is done only once, the runtime does not need to compile, so the program execution of the compiled language is highly efficient. Can run independently from the language environment.

Cons: After compilation, the entire module needs to be recompiled if modifications are required. When compiling the machine code according to the corresponding running environment, porting between different operating systems will be problematic, and you need to compile different executables according to the operating system environment you are running.

Explanatory type:

Pros: Good platform compatibility, can be run in any environment, provided the interpreter (virtual machine) is installed. Flexible, modify the code when the direct modification can be quickly deployed, without downtime maintenance.

Disadvantage: Low operating efficiency because it performs edge-to-forward binary

Ii. advantages and disadvantages of Python

Advantages:

1. High development efficiency, with a very rich third-party library.

2. Portability-can be run on all system platforms.

3. embeddable--can be embedded in C or C + + as a script

4. Extensibility--can embed C or C + + programs in some programs, speed up operational efficiency and hide algorithms

Disadvantages:

1. Slow operation, but it's all relative.

2. Code cannot be encrypted and can only exist in clear text

3. Threads cannot take advantage of multi-CPU issues

Three, the first day of basic work

Age = 56Count=0 whileCount < 3: User_guess= Input ("Input your guess:")    ifInt (user_guess) >Age :Print("try smaller")    elifInt (user_guess) <Age :Print("try bigger")    Else:        Print("You is so clever")         BreakCount+=1ifCount==3: Select= Input ("want to continue? y/n:")        ifselect = ='y': Count=0Else:             Break
Guess age Code

011day--python Basic Knowledge

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.