Python Full stack development day01

Source: Internet
Author: User

1. The first computer CPU: the central processing unit, the equivalent of the brain, Computing and Computing Center memory: temporary storage data (ROM) for the CPU to calculate the advantages: fast reading Speed disadvantage: Small capacity, high cost, power loss is lost: a long time to store large amounts of data. 500G,1T Advantages: Large capacity, low cost, power failure will not disappear shortcomings: slow read operating system: Read data from the hard disk into memory, and then read the data from memory to the CPU, the process is the operating system provisioned by the Windows operating system, Linux operating system, Mac OS 2.python The founder of Http://www.cnblogs.com/jin-xin/articles/7459977.htmlpython is Guido van Rossum (Guido van Rossum) Chinese name: Turtle Uncle 3.python History (focus on understanding the origins of Python2 and Python3) the difference between Python2 and Python3: (from current to 2020 these years 2.7 has been gradually close to 3, until 2020 2.7 completely disappeared) Python2: Source code is not standard (there is close to Java, there is close to c) source confusion, duplicate code is more (the source code is the developer to write for people to use the program) Python3: Re-source code, source code, the pursuit of beautiful, clear, Simple 4. Types of languages (divided into compiled and interpreted types): compiled: Compiles the code all at once into binary form. And then run (write the source file, then compiled into a bytecode file) Advantages: High execution efficiency disadvantage: Slow development, not cross-platform representative of the language is: C-language interpretation: The code is interpreted by line, interpreted as a binary, and then run (the code line-by-row interpretation, edge interpretation side running) Advantages: high development efficiency (third directly to take use), Cross-platform disadvantage: Inefficient execution Python language is an explanatory 5.python advantage and disadvantage: Python benefits: 1.python Beautiful, clear, simple 2. With a strong third-party library, the development efficiency is 3. is a high-level language Python disadvantage: 1. Relative to C language, Java language execution is slower 2. Code cannot be encrypted??? 3. Threads cannot take advantage of multi-CPU problems, which is one of the most common drawbacks of Python??? 6.python Classification Python writing run process (kind) 7. Write the first Python program remember: cmd input python-v Open is Python3 interpreter cmd input python2- V Open is the Python2 interpreter writing the first Python file print (' Hello World ') Python2 version: print ' content ' or print (' content ') python3 version: Only one way to write--print (' content ') run the first Python file Windows key +r Open the command line, enter the Python space file path Enter syntax error: Python2 version: The default encoding is ASCII if you want to display Chinese in the Python2 version, you need to add it in the first line: #-*-Encoding:utf-8-*- Python3 version: The default encoding is UTF-88. The definition of a variable: Store the middle of the calculation so that subsequent code uses the variable's setting rule: A. Must be a letter, number, underline any combination of B. Cannot be a number at the beginning of C. cannot be a keyword in python [' and ', ' As ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ', ' from ', ' GL Obal ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' and ', ' with ', ' Yie LD ']d. Variables cannot be Chinese e. Variables can not be too long f. Variable things are descriptive (see the name and meaning) suggested to set the variable   practice question with an underscore: 1.2. Wrong 3.4. Wrong 5.6. Error 9. Constant: The amount that has remained constant. The default all uppercase variable is a constant. Place it at the beginning of the file. such as: Social Security Number 10. Note: help you understand someone else's code, recall your own code line comment: #被注释的内容多行注释: ' ' Annotated content ' or ' "'" ' "'" "11. Underlying data type: int: number, integer, for calculation. Remainder:% fetch/divide://STR Type: String. In Python, it is the string print (' This is a string ')///single quote print ("This is a string")//double quotation mark//multi-quotation mark (three single quotation mark or three double quotation mark) string that is caused by the NNN number: Add to multiply Str+str: string concatenation str* int: string and integer multiplication, run result is string repeat bool type: true/false Add a Knowledge point: Type ()--View the data type of print (' true ', type (' true '))//strprint (True,type ( True)//boolean Note: The long type is no longer in the Python3, it's all int12.input. User input (user interaction) New Knowledge points * * * Focus: Input out of the data type is the String class # to assign the user input to the name variable, name= input (' Please enter the user name ') #打印输入的内容, Print (name) Exercise: Name=input (' What's your name? ') Age=input (' How old is? ') Hometown=input (' Where is your hometown? ') Print (' Hello ', name, ' Your is ', age, ' years old,you came from ', hometown) 11.if Select the function of the Judgment statement Pass is: Generally in writing business logic when else content is easy to write, So you can first write the business logic inside the else, but if the content is not written in the words Pcharm will be error, so first use pass instead. 1. Individual IFIF conditions: Result  2.if elsename=input (' Please enter your name ') if name== ' Rajah ';p rint ("Old iron, No Problem") else;print (' Faulty to cure ')  3.if elif ... ... 4.if elif. else5. Nested num1=input (' Enter Number ') if num== ' 3 ': num1=input (' Please enter Number ') if num2== ' 5 ':p rint (' This can be guessed right ') else:print (' Keep trying ') ) 12.while Loop Statement while condition: result while running: terminating loop 1. Change condition: Print 1-100 number:  print 0-100 even:  2. Break (can only be used in loops) see break directly end loop print 1+2+3+4+......+1003.continue (can only be used in loops) See continue, end this loop and continue to the next loop. The operation result is: 111 222while ... else??? What scenario is used with other languages else generally only with the if collocation, there is a while in python ... else statement while the else function behind the while loop is to mean that when the while cycle is executed normally, the middle is not interrupted by a break. Will execute the statements after else    exercise 2-4 The idea is very clear, self-made out, stating that the basic knowledge has mastered the exercises 1 and exercises 5 ideas are not clear practice 1 card in7 to get away from this ring, I then forgot 7 or to participate in the cycle, and print out the 7. Exercise 5 cards on I self-increment. Keep in mind that the code runs from top to bottom exercise 6 refer to the teacher's ideas, made out of their own   today's question: 1. The code cannot be encrypted??? 2. Threads cannot take advantage of multi-CPU problems, which is one of the most common drawbacks of Python??? 3.while ... else. In what scenario??? 4.>>> What does this mean???  

Python Full stack development day01

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.