Programming languages: Machine language, assembly language, advanced languages
According to the conversion mode is divided into compiled and interpreted type. Python-interpreted.
Compiled type
Advantages: The program source code "translated" into a machine instruction, and saved as a binary file, can be run directly on the machine, faster than the interpretation of the type.
Cons: Debugging trouble.
Explanatory type
Advantages: Easy to debug the program
Cons: Inefficient, and cannot generate executable files that can be executed independently, the application cannot detach itself from its interpreter. Only in the execution of the program, only one interpretation of the machine language to the computer to execute, so the speed is not as fast as the compiled program to run.
Java code is called a compilation run everywhere, because the Java agent needs to compile into bytecode (an intermediate format of code), and then take the bytecode run everywhere, each run needs to be handed to the JVM to compile machine instructions to execute, so Java is a mixed type
1. The first thing to know is that the PYc bytecode file is generated only when import is imported into the Py file, which can be executed directly in place of the source file.
2. But each time the py file is executed, the resulting bytecode is not preserved, that is, each time the py file is executed, it is to be re-experienced again: Py file--byte code-->python interpreter--machine code, each time is a re-interpretation of the execution of the process.
File header
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Comments
When the line stares: # is annotated content
Multiline Comment: "" "Annotated Content" ""
Python memory management mechanism: https://neo1218.github.io/pymemory/
Input/Output
Import Getpass
n=0
name1= ' Yuyang '
passwd1= ' 123 '
While n<3:
name_=input (' Please input your username: ')
passwd_=getpass.getpass (' Please input your password: ')
if name_ = = name1 and passwd_ ==passwd1:
Break
elif N = = 2:
n=n+1
Continue
Else:
print (' Try Again ')
n=n+1
if n = = 3:
print (' Login failed ')
Else:
print (' Login successfully ')
Operation symbols
Python Getting Started syntax