Main concepts of computer programming

Source: Internet
Author: User

First of all, it should be clear that programming does not require any mathematical and physical knowledge. At most, it only requires numbers, 1, 2, 3, 4, and 5. Mathematical knowledge is used only when a program is used to solve mathematical problems. Generally, network applications, file processing, segmentation, data extraction, and report notifications do not require any mathematical knowledge.

The main content of computer programming is numbers, text, loops, formulas, and variables.

  • Number: 1, 2, 3, 5.6, 120, 32.4, 3.1415926,-3,-0.123.
  • Text: Hello, I am very good, you are too good, very yellow and very violent, such words. It is usually enclosed by double quotation marks (") or single quotation marks. The term is called a string, which is a bunch of characters in string.
  • Loop: loop is a repetitive task. A computer is a very stupid machine. Basically, it only performs simple operations such as addition, subtraction, multiplication, division, greater than, less than, equal to, and loop. Programming is to split complicated problems into simple units for repetition.

    Specifically, a loop is to first set a condition and repeat a series of operations when the condition is met. Until the set conditions are no longer met, you can end the loop.

    Thanks to the formulas mentioned below, many complicated problems have already been solved. We just need to repeat the formulas that others have prepared to solve.

    The biggest advantage of the Python language is that it contains a large number of formulas to solve common problems. What you want is basically done by someone who helps you. You just need to organize them, bind it. For example, the formula for downloading files, the formula for analyzing Web content, the formula for compressing files, and the formula for processing emails.

  • Formula: it is like a mathematical formula (a + B) 2 = a2 + 2AB + B2. Include a specific value, for example: (3 + 4) 2 = 32 + 2*3*4 + 42 = 9 + 24 + 16 = 49. The previous (a + B) 2 is our formula name. Of course, during programming, we use phrases that are easy to understand as the formula name, such as the square of "and, it can be used in English or pinyin. He needs two parameters A and B. The A2 + 2AB + B2 following is the specific calculation step. This is our formula.

    Of course, in programming, our so-called formula is not a mathematical formula, and there is nothing like mathematical derivation or inference. We just bundle the operations we want to do into a heap so that we can reuse these operations in different places. This is the programming formula. In this way, you do not need to repeat the details every time you do the same thing.

    For example, washing clothes, making clothes, making soap, rubbing clothes, casting, and wring out all the things that need to be repeated every time you wash your clothes are turned into one thing by the washing machine, as long as you put in different clothes and wash detergent with different weights, you can let him wash them. After that, open the lid and wash them.

    This washing machine is our formula. The washing process is the operations that we need to repeat each time. The Washing Machine Factory helps us with the same clothes that we put in each time, washing powder of different weights is a set of parameters used in the formula.

    Several small formulas can be combined into a large formula. If you are busy at work, study, do not have time to do housework, or you are just a lazy word, ask a Household Assistant, a household Assistant, a washing machine, a vacuum cleaner, a microwave oven, and so on, coupled with his own operations, combinations, and loops, these small formulas are bundled and become a grand formula. Every time you pay the money, the sanitation will be cleaned and the meal will be ready. The work done by the Household Assistant is a more complicated formula for you. Every time you make an appointment by phone, pay the money to apply the formula for completing housework.

    In a program, the term of a formula is "function" or "method ". We define a function, that is, to define a formula. When we use it, we can just set the formula for parameters A, B, and so on.

    To make the program structure clear, we often define many functions. Divide complex problems into many small problems. Put each small problem into a function, and then use these small problem functions to solve the big problem. More importantly, we can use a lot of functions written by others to solve our own problems.

    The function is used to make the program structure clear and can be applied repeatedly in different places.

  • Variable: indicates the above a, B, which can represent any value. Words, variables, and variables with variable values may change. We use variables to store various numbers, texts, and formulas used in our programs. The so-called parameter is the variable used to define the formula. It is called the parameter. Change the vest.

In terms of terminology, we have:

Number) => Number
String) => Text
Loop) => Loop
Function/Method) => Formula
Variable) => Variable

Basically, there is nothing to learn about programming. The rest is to master the specific function and loop writing formats of various programming languages, and then to master the usage of functions that have been written by others, and then combine them.

Main concepts of computer programming

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: 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.