Mind map
Chapter 1: The way of the program
Map content
Chapter 1: The way of the program
What is a program?
- A program is a sequence of instructions that specifies how to perform a computation.
- What does a program consist of?
- Breaking a large task into many small ones. The tasks usually have the following components
- input
- output
- math
- conditional execution
- repetition
The Python programming language
- python is a high level language
- High level language (vs low level)
- computers can only run low level language programs, but high level ones are easier to program and can run on different platforms with few or no modifications
- How to get from high to low level
- interpreter (the way Python works)
- An interpreter reads a high-level program and executes it, meaning that it does what the program says. It processes the program a little at a time, alternately reading lines and performing computations.
- how to tell the interpreter what to do
- All python programs end in .py. To execute the program, we have to tell the interpreter the name of the script: $ python latoya.py
- compiler
- A compiler reads the program and translates it completely before the program starts running.
- interpreter (the way Python works)
What is debugging?
- fixing programming errors, kind of like science: Once you have an idea what is going wrong, you modify your program and try again.
- Fixing different kinds of errors
- Syntax errors
- Syntax refers to the structure of a program and the rules about that structure.
- Runtime errors
- The second type of error is a runtime error, so called because the error does not appear until you run the program. These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened.
- Semantic errors
- If there is a semantic error in your program, it will run successfully, in the sense that the computer will not generate any error messages, but it will not do the right thing. It will do something else. Specifically, it will do what you told it to do.
- Syntax errors
Formal and natural languages
- formal languages are less ambiguous, more concise, more literal than informal languages
- formal languages
- used by computers
- strict rules about syntax
- tokens
- Tokens are the basic elements of the language, such as words, numbers, and chemical elements.
- structure
- The way the tokens are arranged.
- parsing = figuring out structure
- tokens
- natural languages
- used by people
Information
- Description
- A Gentle Introduction to Programming Using Python (Lecture 1) Mind Map on Chapter 1: The way of the program, created by Silush on 08/11/2014.
- Created by
- Silush · Nov 2014
- Updated
- Feb 19, 2016
- Views
- 8
- Rating