1.1 Computer Basics

1.1.1 Computer characteristics

  • Fast operation speed
  • High calculation accuracy
  • Ability to store and judge logic
  • It has the ability of automatic control

    1.1.2 Common computer Settings and coding

  • A binary number
  • Binary and Other Numbering Systems (1) Decimal (decimal) (2) Octal (octal) (3) Hexadecimal (hexadecimal)
  • Unicode encoding and UTF-8 encoding
  • [hexadecimal conversion] (https://zhuanlan.zhihu.com/p/…

    1.1.3 Composition of computer system

Computer hardware system (computer five components) : arithmetic, controller, memory, input equipment, output equipment. The Arithmetic Unit is also called ALU, and its main function is to carry out Arithmetic operation and basic Logic operation on binary code. The result of operation is directed by the controller to the internal memory. The basic function of the controller is to fetch and execute instructions from internal memory. Memory has a memory function and is used to hold information. The storage capacity of the memory is bytes, each byte has its own number, called the “address”. When a computer processes data, the length of data that can be calculated at a time is called a “word”. A word can be one byte or several bytes. One byte is equal to eight bits. The internal memory is directly connected with the CPU, which has small capacity and fast speed. External memory, hard disk, tape, CD, etc. Input equipment: keyboard and mouse; Output equipment: display, printer, etc.

1.1.4 Operating System

Functions: process management, storage management, device management and file management.

1.1.5 Programming Language

First generation: machine languages consist of binary 0 and 1 codes

Second generation: assembly language

The third generation: high-level language C, Python, Java, etc

Fourth generation: non-procedural languages for two typical applications: database queries and application generators

1.2 Introduction to the Python language

The father of Python was Guido Van Rossum. Guido also loved watching TV. One of his favorite shows is Monty Python and the Fling Circus, after which Python is named. At the end of last year, I could not bear the loneliness of retired life and joined Microsoft and returned to work. Python is a fully object-oriented language. Functions, modules, numbers, and strings are all objects. Python executes by translating the source code in the “.py” file into Python’s byte codes, which are then executed by the Python virtual machine.

1.3 Python Idle Development Environment

1.3.1 Python Idle development environment installation

1, the Windows operating system installed Windows download address] [Python (https://www.python.org/downlo… 2, the Mac operating system installation/download Python Mac address (https://www.python.org/downlo… 3, the UNIX/LINUX operating system install Python UNIX/LINUX download address (https://www.python.org/downlo…

1.3.2 Run the Python program

print("Goodbay World!" )

1.4 Identifiers and Variables

1.4.1 Identifiers and keywords

A identifier is a name that the user uses when programming.

Identifiers can consist of letters, underscores, and numbers, but cannot begin with a number, and Python is case-sensitive.

A keyword is a identifier that has a specific function.

1.4.2 Constants and Variables

Constants are things that don’t change. The main purpose of variables is to store information, and variable names are case sensitive in Python.

1.5 Input and output functions

Print () print() print()

Input string

a = input("Please input a:")
b = input("Please input b:")
c = a + b

Enter an integer

a = int(input("Please input a:"))
b = int(input("Please input b:"))
c = a + b

Enter two strings at a time (separated by Spaces)

a , b= input().split()
c = a + b

Enter two or more integers at a time (separated by Spaces)

a , b= map(int,input().split())
c = a + b
a , b , c, d= map(int,input().split())
e = a + b + c +d