Fun python programming (1. Computer development history)

The future is an era of high technology and intelligence. In the past, people who were illiterate were called "illiterates". Nowadays, if they don't have some computer knowledge, they may be "illiterates" in the new era. No matter what industry you are in, it is beneficial to learn about computers and programming. Python has been at the top of the list of the most popular programming languages ​​for many years. In the future, Python has the opportunity to become a universal language like English.

Preface

The future is an era of high technology and intelligence. No matter what industry you are in, it is beneficial to learn about computers and programming. Python has been at the top of the list of the most popular programming languages ​​for many years. With the widespread learning and application of Python language around the world, Python has the opportunity to become a universal language like English in the future.

Recalling a class in college, the teacher told us about Fourier transform, which made us confused and boring. I raised my hand and asked the teacher why Fourier transform is needed? what's it for? The teacher said that my questions were very good and few students asked them, so I didn’t say more about them. So he told us the meaning and use of Fourier transform, and we listened very carefully. For example, if you ask current graduates, how many of them know what linear algebra is used for? What is the significance of matrix transformation?

This reminds me that my education is all about instilling knowledge without introducing the knowledge background and stimulating students' love and curiosity for knowledge. We should introduce more background of knowledge and let students understand the origin, development process and application value of knowledge. This will not only help students better understand the knowledge, but also stimulate their interest and initiative in learning. Students need to understand the practical application of knowledge and learn how to apply what they have learned to real life, so that they can better consolidate their knowledge and improve their problem-solving abilities.

Our education still lacks the guidance and cultivation of critical thinking. Students need to learn to think independently, analyze problems, and think critically about the knowledge they have learned, so that they can better master knowledge and solve practical problems. Educators should focus on cultivating students' critical thinking and guiding them to learn to question, analyze, demonstrate and evaluate, so as to better cope with the complex and ever-changing world.

Most of the python tutorials currently on the market are either pure lists of knowledge points, or very trivial for children. So I wrote some articles based on my understanding of this aspect, and chose Python as my introduction to computers and programming. Choose python because it has three characteristics that are unmatched by other languages.

  1. The grammar is simple, closest to natural language, has the lowest learning cost, and can be understood and mastered by the largest number of people.
  2. The function library is easy to install, and the function library written by others can be quickly plugged and played, allowing a large amount of value to be exchanged conveniently.
  3. Write once and run anywhere without being restricted by the platform, allowing value to be reflected in more mainstream application scenarios.

Before using Python for programming, we first need to let children understand what a computer is and what programming is. First, let’s understand the basic computer-related knowledge as a whole. Taking into account the children’s cognition, first make up the background in your head, and don’t just start typing code.

What is a computer?

Computer is commonly known as computer. It is a modern intelligent electronic device that can run according to the program and process massive data automatically and at high speed. It consists of a hardware system and a software system. A computer without any software installed is called a bare metal computer. Computers can be used to perform numerical calculations, logical calculations, storage memory, automated control and other functions. It is one of the foundations of the modern information society. It has penetrated into various fields such as human production, scientific research, education, and entertainment, and has become an indispensable tool in people's lives and work.

Today we will explore the basic knowledge and common sense of computers, usually covering the following aspects:

1. Basic components of a computer

A computer is made up of many parts, each with its own function. Memory is the computer's memory system, which stores data and programs. The arithmetic unit is the core part of the computer and can perform various mathematical operations. The controller is the command center of the computer and controls all operations of the computer. Input devices allow you to enter data into your computer, such as keyboards, mice, and touch screens. Output devices display or output the results of computer processing, such as monitors and printers.

2. How computers work

The working process of a computer can be summarized as three steps: input, processing and output. First, you enter instructions and data into the computer through input devices. The computer's arithmetic unit then performs various calculations and processes the data. Finally, the calculation results are displayed through the output device. This process is so fast that computers can perform millions of calculations per second.

3. What is a program?

A program is a collection of computer instructions that tell the computer what to do. You can think of a program as a book, where each line is an instruction that tells the computer what to do. The process of writing a program is to design a series of instructions so that the computer can complete the task according to these instructions.

4. What is the Internet?

The Internet is a network that connects hundreds of millions of computers around the world. It allows people to share information and exchange ideas in different places. You can access various websites, watch videos, chat with friends, and even play games in the virtual world through the Internet. The Internet makes our lives more colorful.

5. What will the computer of the future look like?

Computers of the future will be smarter and more humane. They may have more powerful processing power, richer features, and friendlier user interfaces. At the same time, they may also be more environmentally friendly and sustainable. The development of computers in the future will change the way we live and work, allowing us to obtain information and complete tasks more conveniently.

Computers are an integral part of our lives. It provides us with endless possibilities and opportunities. By understanding the basic knowledge and common sense of computers, we can make better use of it to improve our learning efficiency and quality of life.

Movies about the history of computers

Interest is the best teacher. When learning something new, interest is the best teacher. Interest can stimulate people's inner self-driving force and learning ability to the greatest extent. Here are some computer-related movies that can be recommended to children to increase their understanding and interest in computer history. The deeds of some great people in it are examples for us to learn from.

"Jobs"

This is a biographical film about Apple co-founder Steve Jobs. The film begins with Jobs dropping out of college, describing his experience of focusing on self-exploration and exploration, and co-founding Apple Computer with his like-minded friend Wozniak. The film also shows the highs and lows of Jobs' time running Apple, as well as his experience in founding NeXT and returning to Apple after leaving Apple.

In addition to the movie "Jobs", there are also some films related to computer history. For example:

"Silicon Valley Legend"

This movie tells the history of the development of Apple and Microsoft, including the stories of technology tycoons such as Jobs and Gates.

"Triumph of the Nerds: The Unexpected Rise of an Empire"

This documentary tells the legendary stories of pioneer programmers and computers, including appearances by technology tycoons such as Bill Gates, Paul Allen, Steve Jobs, and Wozniak.

"The Imitation Game": This movie tells the life of Alan Turing, a British mathematician and cryptographer who cracked the German cipher machine "Ingmar" during World War II and created a Contributed to the Allied victory.

"Track Down" and "Freedom Downtime"

If you are interested in hackers, "Takedown" and "Freedom Downtime" must be watched. The two movies tell the story of computer hacker Kevin Mitnick, who was once called "the most wanted computer criminal in American history" by the U.S. Department of Justice. His name was once considered synonymous with "hacker."

"Operating System Revolution"

Under Microsoft's monopoly, many pioneers stood up to resist and worked hard to build a new operating system-Linux, which anyone can use freely. In order to record the difficult journey of these people, this documentary was created.

"Welcome to Macintosh"

The film tells the story of how Apple changed the world through its computer products. Interestingly, the name of the movie comes from the startup greeting of early Mac models - Welcome to Macintosh.

"Social network"

"The Social Network" is based on the social network Facebook and its founder Mark Zuckerberg. It has received rave reviews and won many awards. Some people say that this is a biography about how a genius leads to success. Some people say that the editing and rhythm of the film are well controlled, and it is not dull or cumbersome at all.

These videos can help viewers understand the history of computers and the legendary stories of technology giants, while also stimulating children's interest and enthusiasm for computers.

history of computer development

The history of computer development

The calculation tools we use have evolved from simple to complex, and from low-level to advanced with the development of production and social progress. Calculation tools have successively appeared such as abacus, slide rule, hand-cranked mechanical computer, electric mechanical computer, etc.

In February 1946, the world's first electronic digital computer ENIAC (Electronic Numerical Integrator And Calculator) was born at the University of Pennsylvania in the United States, marking the arrival of the computer age. This computer is composed of more than 18,000 electron tubes, covers an area of ​​170m2, has a total weight of 30t, consumes 150kw/h of power, and has a computing speed of 5,000 times/s. It is the first milestone in the history of computer development.

In 1942, Moakley, who was teaching at the University of Pennsylvania, proposed the idea of ​​using electron tubes to form a computer. This plan attracted the attention of Goldstine, the U.S. Army Ballistic Research Institute. At the time of World War II, ballistic problems in the development of new weapons involved many complex calculations. Manual calculations alone were far from meeting the requirements, and there was an urgent need for automatic calculation machines. So with funding from the U.S. Army Department, the development of ENIAC began in 1943 and was completed in 1946. Its functions were indeed outstanding at the time. For example, it could perform 5,000 addition operations in one second and one multiplication operation in 3 milliseconds. Compared with manual calculations, it was much faster. The ballistic calculation time for a 60-second range was reduced from the original of 20 minutes reduced to 30 seconds. But it also obviously has shortcomings. It is huge in size. There are about 18,800 electron tubes, 1,500 relays, 70,000 resistors and other various electrical components in the machine. It consumes a lot of power when running. In addition, its storage capacity is very small, it can only store 20 decimal digits with a word length of 10 digits, and the program is programmed using line connection. Therefore, every time you solve a problem, you have to manually change the connections and prepare The time greatly exceeds the actual calculation time.

Despite this, the successful development of ENIAC provides an opportunity for the future development of computer science. Every time one of its shortcomings is overcome, it has a great impact on the development of computers. The most influential among them is the adoption of the "program storage" method. . It was the American mathematician Von Neumann who established the idea of ​​program storage as a system. His idea was to set up a memory in the computer, store the symbolic calculation steps in the memory, and then retrieve the stored contents in sequence. Decode and perform calculations based on the decoding results, thereby automating computer work.

In just 50 years, electronic computers have gone through four stages of development: electron tubes, transistors, integrated circuits (IC) and very large-scale integrated circuits (VLSI). Computers are getting smaller and smaller, more powerful, more affordable, and more widely used. They are currently developing towards the fifth generation (intelligent).

The first person in the world to write computer programs was Ada Lovelace. At that time, computers were not widely used and not advanced enough. There were no high-level programming languages. Programs were entered into the computer through punching holes. Programmers use special punch machines to convert programs into binary code that the computer can understand. The holes are punched into a piece of paper, which is then put into a computer for processing.

Although it sounds inconvenient to write programs in paper bags, at that time, there was no way. High-level languages ​​had not yet been born, so we could only write primitive languages ​​​​such as 0101 that machines can understand. Programmers need to write programs on paper and then submit them to computer operators for input and processing. Programs back then often required multiple modifications and tests before they would run correctly.

2. The four eras through which computers have developed

Era

element

first generation

1946-1958

electron tube

second generation

1959-1964

transistor

Third Generation

1965-1970

integrated circuit

Fourth Generation

1971-present

large scale integrated circuit

First generation: tube computer era (1946--1956) 

Introduction: Due to the use of rectifier tubes, this generation of computers is large in size, consumes a lot of power, has low computing efficiency, small storage capacity, and poor reliability;

Main features: The use of electron tubes as the main logic components of the computer is large in size, consumes a lot of power, has a short lifespan and is high in cost. The electron tube is shown in the figure. Typical machines of this period:

Foreign: ENIAC, UNIVAC.

Domestic: 103, 104, etc.

Second generation: transistor computer era (1956--1964) 

Introduction:The performance of this generation of computers is tens of times greater than that of the first generation of computers. Mobile phone software configurations are gradually emerging, some advanced programming languages ​​have come out one after another, and external devices have also been developed. Several categories were upgraded to dozens. In addition to the application of computers, applications such as data processing methods and industrial control systems have begun.

main feature:

Using transistors as the main logic components of computers reduces volume, weight, costs, and energy consumption. The transistor is shown in the figure. Typical machines of this period:

Foreign: IBM7090, etc., as shown in the picture.

Domestic: 441B, etc.

The third generation: Integrated circuit computer era (1964--1972)

Introduction: It mainly consists of medium and small-scale taxpayer integrated circuits. Its power circuit components integrate dozens to dozens of electronic components on a processing chip with several square meters of wires, which significantly reduces the size and power consumption of the computer, and improves processing speed, storage capacity, and reliability. A great improvement, with computer operating systems, diversified and universal models, and integration with communication technology, allowing computer applications to enter many technologically advanced industries.

Main features: The use of medium and small-scale integrated circuits as the main logic components makes the computer smaller, lighter, consumes less power, has a longer life, lower costs, and greatly improves the computing speed. The integrated circuit is shown in the figure.

Typical machines of this period:

Foreign: IBM-360, etc.

Domestic: 709 etc.

As shown in the picture, can you imagine that the first generation of Apple computers looked like this?

The fourth generation: large-scale and very large-scale integrated circuit computer era (1972--present)

Introduction:Scale integrated circuit is a semiconductor chip with a few square meters of wires that can integrate up to 100,000 electronic components, making computers< a i=2>The size is smaller, the power consumption is less, the calculation rate is increased to millions of times per second, and the computer reliability is further improved.

Main features: Using large-scale and ultra-large-scale integrated circuits as basic logic components, the computer size, weight and cost are greatly reduced, and the computing speed and reliability are greatly improved. A large scale integrated circuit is shown in the figure.

Typical machines of this period:

Overseas: IBM-370, etc.

Domestic: Galaxy, etc.

In the late 1980s, IBM-PC began to emerge as a new force, facing the PC's ultra-fast processor, large memory, rich interfaces, high-resolution image quality, and various practical software.

Today's PC computers include two common types: desktop computers and laptop computers.

What is a programming language

Before formally learning programming, we must first understand the concept of programming language.

When we were very young, our parents taught us how to speak and how to understand what others meant. After a long period of edification and self-study, we unknowingly learned to speak and understand what other children were saying, so we began to use language to communicate with others.

There are many languages ​​in the world, including Chinese, English, Japanese, Russian, etc. Each language has a fixed format, such as Chinese (Chinese). Each Chinese character represents a different meaning. We must express it correctly in order to Let the other person understand. For example, if you ask your parents to give you 10 yuan of pocket money, you will say, "Dad gave me 10 yuan, and I want to buy snacks." If you say, "Dad gave me 10 yuan to buy snacks, I want it." Your parents will find it strange and won't listen. Understand what we mean, and even draw reproach from them.

Communicate with your parents through "language" with fixed formats and fixed vocabulary, and let your parents fulfill your wishes, thereby achieving the purpose of "controlling" your parents. This is the role of language. Similarly, we can also control the computer through "language" and let the computer do things for us. Such a language is called a programming language (Programming Language). Like human languages, there are many kinds of programming languages. According to incomplete statistics, there are more than 600 programming languages ​​​​in the world, of which there are more than 20 popular languages, such as C language, C++, Java, Python, PHP, C#, JavaScript etc. Each of these languages ​​has its own merits and strengths:

Table 1: Programming languages
programming language The main purpose
C/C++ C++ was developed on the basis of C language. C++ contains all the contents of C language. C language is a part of C++. They are often mixed together, so they are collectively called C/C++. C/C++ is mainly used for PC software development, Linux development, game development, microcontrollers and embedded systems.
Python Python is mainly used in automated operation and maintenance, website development, data analysis, artificial intelligence, cloud computing and other technical fields, and has gained momentum in recent years. , favored by developers.
Java Java can be used for website backend development, Android development, and PC software development. In recent years, it has also been involved in Big Datafield (this is mainly due to the popularity of the Hadoop framework).
PHP PHP is mainly used to develop website backend programs.
C# The implementation mechanism of C# is similar to that of Java. It is currently mainly used for software development on the Windows platform and a small amount of website backend development.
JavaScript JavaScript was initially only used for website front-end development and was the only language for front-end development. In recent years, due to the popularity of Node.js, JavaScript has also occupied a place in website backend development and is growing rapidly.

Different programming languages ​​can be compared to the languages ​​of various countries. In order to express the same meaning, different statements may be used. For example, to express "Hello world":

  • Chinese: Hello world
  • English: Hello World
  • Japanese: Hello the world

For programming languages, different statements are required to perform the same operation. As a simple example, display "Hello, world" on the screen:

  • C language: printf("Hello, world");
  • PHP:echo "Hello,world";
  • Python:print("Hello,world")

As can be seen from the example, programming language is similar to human language and is composed of intuitive vocabulary. We can easily understand its meaning. For example, in Python, we use print() to let the computer display text on the screen. The original meaning of print in English is printing and output. We can easily understand it; at the same time, we must also pay attention to the statement format. Put the content to be displayed Hello, C语言中文网 plus English status quotation marks "" in brackets. This is the format specified by the Python language, and we must write it like this.

Each programming language has fixed vocabulary and formats. Learning a programming language is essentially learning how to use these vocabulary and formats.

Summary: A programming language is a series of instructions (Instructions) used to control a computer. It has a fixed format and vocabulary (the formats and vocabulary of different programming languages ​​are different), which must be followed, otherwise errors will occur. It doesn't serve our purpose. Traditionally, we call these instructions code, and these codes together form a computer program For a simple example, to calculate the sum of two numbers, the machine language needs to control the computer to complete the following operations in sequence: The programming languages ​​mentioned in Table 1 are all high-level computer languages, and they are designed to facilitate programmers' understanding and use. But strictly speaking, computers can only understand a very low-level programming language, which is machine language. . coding, and the process of writing programs in a programming language is called


  • Load the number located at 0x0001 in the memory space into the CPU;
  • Then load the number located at 0x0010 in the memory space into the CPU;
  • In the CPU, perform a sum operation on these two numbers;
  • Store the result in the memory space at location 0x0011.

CPU (Central Processing Unit, referred to as CPU) is the central processing unit, which is the computing and control core of the computer. It is equivalent to the brain of the computer. All machine instructions are executed by the CPU.

As you can see, there is so much work required to perform the sum operation of 2 numbers. This is just a general description. In fact, it will be more complicated. Using a high-level language like Python, the sum of two numbers can be expressed directly in the form a + b. Demonstration using Python below:

>>> 2+3
5

Although this method is light and fast, it also brings problems. We need to design a method to translate high-level language into machine language that the computer can execute. Currently, there are two ways to achieve this, namely compiler and interpreter.

A high-level language that uses a compiler to convert itself into machine language is often called a compiled language; while an interpreter is used A high-level language that converts itself into machine language is called an interpreted language. Python is an interpreted programming language.

Introduction to Python language

The birth of Python is very dramatic. According to Guido's self-report, the Python language was developed during the Christmas period to kill boring time. The reason why Python was chosen as the name of the programming language is because Guido is a Monty Python drama A loyal fan of the group.

Python is a high-level programming language that has the advantages of being easy to learn, highly readable, and widely used. It was created by Guido van Rossum in 1989 and follows the design philosophy of "elegant and clear". Python's syntax is clear and concise, and it supports multiple programming paradigms such as object-oriented programming and functional programming.

The following are some of the main features of the Python language:

  1. Easy to learn: Python's syntax is clear and concise, making it easy to understand and write. For beginners, Python is a great language to start learning programming.
  2. Powerful standard library: Python has a huge standard library that provides many modules and functions for various tasks, such as file processing, network programming, data analysis, etc. .
  3. Dynamic typing: Python is a dynamically typed language, which means you do not need to declare the type of variables in advance. This can make the code cleaner, but also be aware of possible type-related errors.
  4. Interpreted Language: Python is an interpreted language, which means you can run code line by line without first compiling it into machine language. This brings a lot of flexibility and operability to Python.
  5. Object-oriented programming: Python supports object-oriented programming, which allows you to use classes and objects to organize and encapsulate data and operations.
  6. Functional programming: Python also supports functional programming, including higher-order functions and lambda expressions.
  7. Rich third-party libraries: Python has a huge third-party library ecosystem called PyPI (Python Package Index). These libraries provide endless possibilities for Python, from data processing to machine learning to web development and more.
  8. Cross-platform: Python can run on a variety of operating systems, including Windows, Linux and Mac OS.
  9. Strong community support: Python has an active developer and user community that provides a wealth of resources, tutorials, and learning materials.
  10. Extensibility: If necessary, you can write Python extension modules in languages ​​such as C or C++ to improve the running efficiency of the program.

Python is widely used in web development, data analysis, artificial intelligence, scientific computing, scripting and other fields. Moreover, due to Python's open source nature and wide range of applications, it has become one of the most popular programming languages ​​today.

There has been a saying on the Internet that "life is short, I use Python", and this statement is true!

In 2017, the Zhejiang Province Information Technology Curriculum Reform Plan was released, and Python was included in the Zhejiang Province Information Technology College Entrance Examination. In December of the same year, Shandong Province also included Python-related content in its latest published sixth-grade primary school information technology textbook. It can be seen that Python is gradually becoming popular among primary and secondary school students.

This tutorial is intended for primary and secondary school students. The idea that is always implemented is to learn Python from scratch and start learning from scratch.

Other resources

Introduction to the history of computer development (detailed)-CSDN Blog

[Computer Basics Learned in Those Years]--History of Computer Development (Picture Version)_Pictures of the Evolution of Computers-CSDN Blog

Python 3 Tutorial | Tutorial for Newbies

A brief history of computer learning machines--Chapter 4 The rise of domestic computer learning machines (10) - Bilibili

Guess you like

Origin blog.csdn.net/qq8864/article/details/134443573